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