Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56019 - in trunk: boost/thread libs/thread/build libs/thread/src/pthread libs/thread/src/win32
From: anthony_at_[hidden]
Date: 2009-09-04 15:55:32


Author: anthonyw
Date: 2009-09-04 15:55:31 EDT (Fri, 04 Sep 2009)
New Revision: 56019
URL: http://svn.boost.org/trac/boost/changeset/56019

Log:
boost.thread exception types are now header-only so some uses of boost.thread can be header only
Removed:
   trunk/libs/thread/src/pthread/exceptions.cpp
   trunk/libs/thread/src/win32/exceptions.cpp
Text files modified:
   trunk/boost/thread/exceptions.hpp | 190 +++++++++++++++++++++++++++------------
   trunk/libs/thread/build/Jamfile.v2 | 2
   2 files changed, 129 insertions(+), 63 deletions(-)

Modified: trunk/boost/thread/exceptions.hpp
==============================================================================
--- trunk/boost/thread/exceptions.hpp (original)
+++ trunk/boost/thread/exceptions.hpp 2009-09-04 15:55:31 EDT (Fri, 04 Sep 2009)
@@ -1,6 +1,6 @@
 // Copyright (C) 2001-2003
 // William E. Kempf
-// Copyright (C) 2007-8 Anthony Williams
+// Copyright (C) 2007-9 Anthony Williams
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -24,23 +24,36 @@
 namespace boost
 {
 
- class BOOST_THREAD_DECL thread_interrupted
+ class thread_interrupted
     {};
 
-class BOOST_THREAD_DECL thread_exception : public std::exception
-{
-protected:
- thread_exception();
- thread_exception(int sys_err_code);
-
-public:
- ~thread_exception() throw();
-
- int native_error() const;
-
-private:
- int m_sys_err;
-};
+ class thread_exception:
+ public std::exception
+ {
+ protected:
+ thread_exception():
+ m_sys_err(0)
+ {}
+
+ thread_exception(int sys_err_code):
+ m_sys_err(sys_err_code)
+ {}
+
+
+ public:
+ ~thread_exception() throw()
+ {}
+
+
+ int native_error() const
+ {
+ return m_sys_err;
+ }
+
+
+ private:
+ int m_sys_err;
+ };
 
     class condition_error:
         public std::exception
@@ -53,62 +66,117 @@
     };
     
 
-class BOOST_THREAD_DECL lock_error : public thread_exception
-{
-public:
- lock_error();
- lock_error(int sys_err_code);
- ~lock_error() throw();
+ class lock_error:
+ public thread_exception
+ {
+ public:
+ lock_error()
+ {}
+
+ lock_error(int sys_err_code):
+ thread_exception(sys_err_code)
+ {}
+
+ ~lock_error() throw()
+ {}
+
 
- virtual const char* what() const throw();
-};
+ virtual const char* what() const throw()
+ {
+ return "boost::lock_error";
+ }
+ };
 
-class BOOST_THREAD_DECL thread_resource_error : public thread_exception
-{
-public:
- thread_resource_error();
- thread_resource_error(int sys_err_code);
- ~thread_resource_error() throw();
+ class thread_resource_error:
+ public thread_exception
+ {
+ public:
+ thread_resource_error()
+ {}
+
+ thread_resource_error(int sys_err_code):
+ thread_exception(sys_err_code)
+ {}
+
+ ~thread_resource_error() throw()
+ {}
+
 
- virtual const char* what() const throw();
-};
+ virtual const char* what() const throw()
+ {
+ return "boost::thread_resource_error";
+ }
+
+ };
 
-class BOOST_THREAD_DECL unsupported_thread_option : public thread_exception
-{
-public:
- unsupported_thread_option();
- unsupported_thread_option(int sys_err_code);
- ~unsupported_thread_option() throw();
+ class unsupported_thread_option:
+ public thread_exception
+ {
+ public:
+ unsupported_thread_option()
+ {}
+
+ unsupported_thread_option(int sys_err_code):
+ thread_exception(sys_err_code)
+ {}
+
+ ~unsupported_thread_option() throw()
+ {}
+
 
- virtual const char* what() const throw();
-};
+ virtual const char* what() const throw()
+ {
+ return "boost::unsupported_thread_option";
+ }
+
+ };
 
-class BOOST_THREAD_DECL invalid_thread_argument : public thread_exception
-{
-public:
- invalid_thread_argument();
- invalid_thread_argument(int sys_err_code);
- ~invalid_thread_argument() throw();
+ class invalid_thread_argument:
+ public thread_exception
+ {
+ public:
+ invalid_thread_argument()
+ {}
+
+ invalid_thread_argument(int sys_err_code):
+ thread_exception(sys_err_code)
+ {}
+
+ ~invalid_thread_argument() throw()
+ {}
+
 
- virtual const char* what() const throw();
-};
+ virtual const char* what() const throw()
+ {
+ return "boost::invalid_thread_argument";
+ }
+
+ };
 
-class BOOST_THREAD_DECL thread_permission_error : public thread_exception
-{
-public:
- thread_permission_error();
- thread_permission_error(int sys_err_code);
- ~thread_permission_error() throw();
+ class thread_permission_error:
+ public thread_exception
+ {
+ public:
+ thread_permission_error()
+ {}
+
+ thread_permission_error(int sys_err_code):
+ thread_exception(sys_err_code)
+ {}
+
+ ~thread_permission_error() throw()
+ {}
+
 
- virtual const char* what() const throw();
-};
+ virtual const char* what() const throw()
+ {
+ return "boost::thread_permission_error";
+ }
+
+ };
 
 } // namespace boost
 
 #include <boost/config/abi_suffix.hpp>
 
-#endif // BOOST_THREAD_CONFIG_PDM070801_H
-
-// Change log:
-// 3 Jan 03 WEKEMPF Modified for DLL implementation.
-
+#endif

Modified: trunk/libs/thread/build/Jamfile.v2
==============================================================================
--- trunk/libs/thread/build/Jamfile.v2 (original)
+++ trunk/libs/thread/build/Jamfile.v2 2009-09-04 15:55:31 EDT (Fri, 04 Sep 2009)
@@ -180,7 +180,6 @@
 alias thread_sources
     : ## win32 sources ##
       win32/thread.cpp
- win32/exceptions.cpp
       win32/tss_dll.cpp
       win32/tss_pe.cpp
     : ## requirements ##
@@ -190,7 +189,6 @@
 alias thread_sources
     : ## pthread sources ##
       pthread/thread.cpp
- pthread/exceptions.cpp
       pthread/once.cpp
     : ## requirements ##
       <threadapi>pthread

Deleted: trunk/libs/thread/src/pthread/exceptions.cpp
==============================================================================
--- trunk/libs/thread/src/pthread/exceptions.cpp 2009-09-04 15:55:31 EDT (Fri, 04 Sep 2009)
+++ (empty file)
@@ -1,124 +0,0 @@
-// Copyright (C) 2001-2003
-// William E. Kempf
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#include <boost/thread/detail/config.hpp>
-
-#include <boost/thread/exceptions.hpp>
-#include <cstring>
-#include <string>
-
-namespace boost {
-
-thread_exception::thread_exception()
- : m_sys_err(0)
-{
-}
-
-thread_exception::thread_exception(int sys_err_code)
- : m_sys_err(sys_err_code)
-{
-}
-
-thread_exception::~thread_exception() throw()
-{
-}
-
-int thread_exception::native_error() const
-{
- return m_sys_err;
-}
-
-lock_error::lock_error()
-{
-}
-
-lock_error::lock_error(int sys_err_code)
- : thread_exception(sys_err_code)
-{
-}
-
-lock_error::~lock_error() throw()
-{
-}
-
-const char* lock_error::what() const throw()
-{
- return "boost::lock_error";
-}
-
-thread_resource_error::thread_resource_error()
-{
-}
-
-thread_resource_error::thread_resource_error(int sys_err_code)
- : thread_exception(sys_err_code)
-{
-}
-
-thread_resource_error::~thread_resource_error() throw()
-{
-}
-
-const char* thread_resource_error::what() const throw()
-{
- return "boost::thread_resource_error";
-}
-
-unsupported_thread_option::unsupported_thread_option()
-{
-}
-
-unsupported_thread_option::unsupported_thread_option(int sys_err_code)
- : thread_exception(sys_err_code)
-{
-}
-
-unsupported_thread_option::~unsupported_thread_option() throw()
-{
-}
-
-const char* unsupported_thread_option::what() const throw()
-{
- return "boost::unsupported_thread_option";
-}
-
-invalid_thread_argument::invalid_thread_argument()
-{
-}
-
-invalid_thread_argument::invalid_thread_argument(int sys_err_code)
- : thread_exception(sys_err_code)
-{
-}
-
-invalid_thread_argument::~invalid_thread_argument() throw()
-{
-}
-
-const char* invalid_thread_argument::what() const throw()
-{
- return "boost::invalid_thread_argument";
-}
-
-thread_permission_error::thread_permission_error()
-{
-}
-
-thread_permission_error::thread_permission_error(int sys_err_code)
- : thread_exception(sys_err_code)
-{
-}
-
-thread_permission_error::~thread_permission_error() throw()
-{
-}
-
-const char* thread_permission_error::what() const throw()
-{
- return "boost::thread_permission_error";
-}
-
-} // namespace boost

Deleted: trunk/libs/thread/src/win32/exceptions.cpp
==============================================================================
--- trunk/libs/thread/src/win32/exceptions.cpp 2009-09-04 15:55:31 EDT (Fri, 04 Sep 2009)
+++ (empty file)
@@ -1,124 +0,0 @@
-// Copyright (C) 2001-2003
-// William E. Kempf
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#include <boost/thread/detail/config.hpp>
-
-#include <boost/thread/exceptions.hpp>
-#include <cstring>
-#include <string>
-
-namespace boost {
-
-thread_exception::thread_exception()
- : m_sys_err(0)
-{
-}
-
-thread_exception::thread_exception(int sys_err_code)
- : m_sys_err(sys_err_code)
-{
-}
-
-thread_exception::~thread_exception() throw()
-{
-}
-
-int thread_exception::native_error() const
-{
- return m_sys_err;
-}
-
-lock_error::lock_error()
-{
-}
-
-lock_error::lock_error(int sys_err_code)
- : thread_exception(sys_err_code)
-{
-}
-
-lock_error::~lock_error() throw()
-{
-}
-
-const char* lock_error::what() const throw()
-{
- return "boost::lock_error";
-}
-
-thread_resource_error::thread_resource_error()
-{
-}
-
-thread_resource_error::thread_resource_error(int sys_err_code)
- : thread_exception(sys_err_code)
-{
-}
-
-thread_resource_error::~thread_resource_error() throw()
-{
-}
-
-const char* thread_resource_error::what() const throw()
-{
- return "boost::thread_resource_error";
-}
-
-unsupported_thread_option::unsupported_thread_option()
-{
-}
-
-unsupported_thread_option::unsupported_thread_option(int sys_err_code)
- : thread_exception(sys_err_code)
-{
-}
-
-unsupported_thread_option::~unsupported_thread_option() throw()
-{
-}
-
-const char* unsupported_thread_option::what() const throw()
-{
- return "boost::unsupported_thread_option";
-}
-
-invalid_thread_argument::invalid_thread_argument()
-{
-}
-
-invalid_thread_argument::invalid_thread_argument(int sys_err_code)
- : thread_exception(sys_err_code)
-{
-}
-
-invalid_thread_argument::~invalid_thread_argument() throw()
-{
-}
-
-const char* invalid_thread_argument::what() const throw()
-{
- return "boost::invalid_thread_argument";
-}
-
-thread_permission_error::thread_permission_error()
-{
-}
-
-thread_permission_error::thread_permission_error(int sys_err_code)
- : thread_exception(sys_err_code)
-{
-}
-
-thread_permission_error::~thread_permission_error() throw()
-{
-}
-
-const char* thread_permission_error::what() const throw()
-{
- return "boost::thread_permission_error";
-}
-
-} // namespace boost


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk