Added Boost.thread library.
[PaGMO.git] / boost_thread / win32 / exceptions.cpp
blob8881303607c15e090a40a57dc7426489c50f8f35
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)
7 #include <boost/thread/detail/config.hpp>
9 #include <boost/thread/exceptions.hpp>
10 #include <cstring>
11 #include <string>
13 namespace boost {
15 thread_exception::thread_exception()
16 : m_sys_err(0)
20 thread_exception::thread_exception(int sys_err_code)
21 : m_sys_err(sys_err_code)
25 thread_exception::~thread_exception() throw()
29 int thread_exception::native_error() const
31 return m_sys_err;
34 lock_error::lock_error()
38 lock_error::lock_error(int sys_err_code)
39 : thread_exception(sys_err_code)
43 lock_error::~lock_error() throw()
47 const char* lock_error::what() const throw()
49 return "boost::lock_error";
52 thread_resource_error::thread_resource_error()
56 thread_resource_error::thread_resource_error(int sys_err_code)
57 : thread_exception(sys_err_code)
61 thread_resource_error::~thread_resource_error() throw()
65 const char* thread_resource_error::what() const throw()
67 return "boost::thread_resource_error";
70 unsupported_thread_option::unsupported_thread_option()
74 unsupported_thread_option::unsupported_thread_option(int sys_err_code)
75 : thread_exception(sys_err_code)
79 unsupported_thread_option::~unsupported_thread_option() throw()
83 const char* unsupported_thread_option::what() const throw()
85 return "boost::unsupported_thread_option";
88 invalid_thread_argument::invalid_thread_argument()
92 invalid_thread_argument::invalid_thread_argument(int sys_err_code)
93 : thread_exception(sys_err_code)
97 invalid_thread_argument::~invalid_thread_argument() throw()
101 const char* invalid_thread_argument::what() const throw()
103 return "boost::invalid_thread_argument";
106 thread_permission_error::thread_permission_error()
110 thread_permission_error::thread_permission_error(int sys_err_code)
111 : thread_exception(sys_err_code)
115 thread_permission_error::~thread_permission_error() throw()
119 const char* thread_permission_error::what() const throw()
121 return "boost::thread_permission_error";
124 } // namespace boost