[857] | 1 | // Copyright (C) 2001-2003
|
---|
| 2 | // William E. Kempf
|
---|
| 3 | //
|
---|
| 4 | // Permission to use, copy, modify, distribute and sell this software
|
---|
| 5 | // and its documentation for any purpose is hereby granted without fee,
|
---|
| 6 | // provided that the above copyright notice appear in all copies and
|
---|
| 7 | // that both that copyright notice and this permission notice appear
|
---|
| 8 | // in supporting documentation. William E. Kempf makes no representations
|
---|
| 9 | // about the suitability of this software for any purpose.
|
---|
| 10 | // It is provided "as is" without express or implied warranty.
|
---|
| 11 |
|
---|
| 12 | #ifndef BOOST_THREAD_EXCEPTIONS_PDM070801_H
|
---|
| 13 | #define BOOST_THREAD_EXCEPTIONS_PDM070801_H
|
---|
| 14 |
|
---|
| 15 | #include <boost/thread/detail/config.hpp>
|
---|
| 16 |
|
---|
| 17 | // pdm: Sorry, but this class is used all over the place & I end up
|
---|
| 18 | // with recursive headers if I don't separate it
|
---|
| 19 | // wek: Not sure why recursive headers would cause compilation problems
|
---|
| 20 | // given the include guards, but regardless it makes sense to
|
---|
| 21 | // seperate this out any way.
|
---|
| 22 |
|
---|
| 23 | #include <string>
|
---|
| 24 | #include <stdexcept>
|
---|
| 25 |
|
---|
| 26 | namespace boost {
|
---|
| 27 |
|
---|
| 28 | class BOOST_THREAD_DECL thread_exception : public std::exception
|
---|
| 29 | {
|
---|
| 30 | protected:
|
---|
| 31 | thread_exception();
|
---|
| 32 | thread_exception(int sys_err_code);
|
---|
| 33 |
|
---|
| 34 | public:
|
---|
| 35 | ~thread_exception() throw();
|
---|
| 36 |
|
---|
| 37 | int native_error() const;
|
---|
| 38 |
|
---|
| 39 | const char* message() const;
|
---|
| 40 |
|
---|
| 41 | private:
|
---|
| 42 | int m_sys_err;
|
---|
| 43 | };
|
---|
| 44 |
|
---|
| 45 | class BOOST_THREAD_DECL lock_error : public thread_exception
|
---|
| 46 | {
|
---|
| 47 | public:
|
---|
| 48 | lock_error();
|
---|
| 49 | lock_error(int sys_err_code);
|
---|
| 50 | ~lock_error() throw();
|
---|
| 51 |
|
---|
| 52 | virtual const char* what() const throw();
|
---|
| 53 | };
|
---|
| 54 |
|
---|
| 55 | class BOOST_THREAD_DECL thread_resource_error : public thread_exception
|
---|
| 56 | {
|
---|
| 57 | public:
|
---|
| 58 | thread_resource_error();
|
---|
| 59 | thread_resource_error(int sys_err_code);
|
---|
| 60 | ~thread_resource_error() throw();
|
---|
| 61 |
|
---|
| 62 | virtual const char* what() const throw();
|
---|
| 63 | };
|
---|
| 64 |
|
---|
| 65 | class BOOST_THREAD_DECL unsupported_thread_option : public thread_exception
|
---|
| 66 | {
|
---|
| 67 | public:
|
---|
| 68 | unsupported_thread_option();
|
---|
| 69 | unsupported_thread_option(int sys_err_code);
|
---|
| 70 | ~unsupported_thread_option() throw();
|
---|
| 71 |
|
---|
| 72 | virtual const char* what() const throw();
|
---|
| 73 | };
|
---|
| 74 |
|
---|
| 75 | class BOOST_THREAD_DECL invalid_thread_argument : public thread_exception
|
---|
| 76 | {
|
---|
| 77 | public:
|
---|
| 78 | invalid_thread_argument();
|
---|
| 79 | invalid_thread_argument(int sys_err_code);
|
---|
| 80 | ~invalid_thread_argument() throw();
|
---|
| 81 |
|
---|
| 82 | virtual const char* what() const throw();
|
---|
| 83 | };
|
---|
| 84 |
|
---|
| 85 | class BOOST_THREAD_DECL thread_permission_error : public thread_exception
|
---|
| 86 | {
|
---|
| 87 | public:
|
---|
| 88 | thread_permission_error();
|
---|
| 89 | thread_permission_error(int sys_err_code);
|
---|
| 90 | ~thread_permission_error() throw();
|
---|
| 91 |
|
---|
| 92 | virtual const char* what() const throw();
|
---|
| 93 | };
|
---|
| 94 |
|
---|
| 95 | } // namespace boost
|
---|
| 96 |
|
---|
| 97 | #endif // BOOST_THREAD_CONFIG_PDM070801_H
|
---|
| 98 |
|
---|
| 99 | // Change log:
|
---|
| 100 | // 3 Jan 03 WEKEMPF Modified for DLL implementation.
|
---|
| 101 |
|
---|