[29] | 1 | // Copyright (C) 2001-2003 |
---|
| 2 | // William E. Kempf |
---|
| 3 | // |
---|
| 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying |
---|
| 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
---|
| 6 | |
---|
| 7 | #ifndef BOOST_THREAD_EXCEPTIONS_PDM070801_H |
---|
| 8 | #define BOOST_THREAD_EXCEPTIONS_PDM070801_H |
---|
| 9 | |
---|
| 10 | #include <boost/thread/detail/config.hpp> |
---|
| 11 | |
---|
| 12 | // pdm: Sorry, but this class is used all over the place & I end up |
---|
| 13 | // with recursive headers if I don't separate it |
---|
| 14 | // wek: Not sure why recursive headers would cause compilation problems |
---|
| 15 | // given the include guards, but regardless it makes sense to |
---|
| 16 | // seperate this out any way. |
---|
| 17 | |
---|
| 18 | #include <string> |
---|
| 19 | #include <stdexcept> |
---|
| 20 | |
---|
| 21 | namespace boost { |
---|
| 22 | |
---|
| 23 | class BOOST_THREAD_DECL thread_exception : public std::exception |
---|
| 24 | { |
---|
| 25 | protected: |
---|
| 26 | thread_exception(); |
---|
| 27 | thread_exception(int sys_err_code); |
---|
| 28 | |
---|
| 29 | public: |
---|
| 30 | ~thread_exception() throw(); |
---|
| 31 | |
---|
| 32 | int native_error() const; |
---|
| 33 | |
---|
| 34 | private: |
---|
| 35 | int m_sys_err; |
---|
| 36 | }; |
---|
| 37 | |
---|
| 38 | class BOOST_THREAD_DECL lock_error : public thread_exception |
---|
| 39 | { |
---|
| 40 | public: |
---|
| 41 | lock_error(); |
---|
| 42 | lock_error(int sys_err_code); |
---|
| 43 | ~lock_error() throw(); |
---|
| 44 | |
---|
| 45 | virtual const char* what() const throw(); |
---|
| 46 | }; |
---|
| 47 | |
---|
| 48 | class BOOST_THREAD_DECL thread_resource_error : public thread_exception |
---|
| 49 | { |
---|
| 50 | public: |
---|
| 51 | thread_resource_error(); |
---|
| 52 | thread_resource_error(int sys_err_code); |
---|
| 53 | ~thread_resource_error() throw(); |
---|
| 54 | |
---|
| 55 | virtual const char* what() const throw(); |
---|
| 56 | }; |
---|
| 57 | |
---|
| 58 | class BOOST_THREAD_DECL unsupported_thread_option : public thread_exception |
---|
| 59 | { |
---|
| 60 | public: |
---|
| 61 | unsupported_thread_option(); |
---|
| 62 | unsupported_thread_option(int sys_err_code); |
---|
| 63 | ~unsupported_thread_option() throw(); |
---|
| 64 | |
---|
| 65 | virtual const char* what() const throw(); |
---|
| 66 | }; |
---|
| 67 | |
---|
| 68 | class BOOST_THREAD_DECL invalid_thread_argument : public thread_exception |
---|
| 69 | { |
---|
| 70 | public: |
---|
| 71 | invalid_thread_argument(); |
---|
| 72 | invalid_thread_argument(int sys_err_code); |
---|
| 73 | ~invalid_thread_argument() throw(); |
---|
| 74 | |
---|
| 75 | virtual const char* what() const throw(); |
---|
| 76 | }; |
---|
| 77 | |
---|
| 78 | class BOOST_THREAD_DECL thread_permission_error : public thread_exception |
---|
| 79 | { |
---|
| 80 | public: |
---|
| 81 | thread_permission_error(); |
---|
| 82 | thread_permission_error(int sys_err_code); |
---|
| 83 | ~thread_permission_error() throw(); |
---|
| 84 | |
---|
| 85 | virtual const char* what() const throw(); |
---|
| 86 | }; |
---|
| 87 | |
---|
| 88 | } // namespace boost |
---|
| 89 | |
---|
| 90 | #endif // BOOST_THREAD_CONFIG_PDM070801_H |
---|
| 91 | |
---|
| 92 | // Change log: |
---|
| 93 | // 3 Jan 03 WEKEMPF Modified for DLL implementation. |
---|
| 94 | |
---|