diff -r 510d5bd079ad boost/thread/locks.hpp
a
|
b
|
|
137 | 137 | { |
138 | 138 | if(owns_lock()) |
139 | 139 | { |
140 | | throw boost::lock_error(); |
| 140 | boost::throw_exception(boost::lock_error()); |
141 | 141 | } |
142 | 142 | m->lock(); |
143 | 143 | is_locked=true; |
… |
… |
|
146 | 146 | { |
147 | 147 | if(owns_lock()) |
148 | 148 | { |
149 | | throw boost::lock_error(); |
| 149 | boost::throw_exception(boost::lock_error()); |
150 | 150 | } |
151 | 151 | is_locked=m->try_lock(); |
152 | 152 | return is_locked; |
… |
… |
|
167 | 167 | { |
168 | 168 | if(!owns_lock()) |
169 | 169 | { |
170 | | throw boost::lock_error(); |
| 170 | boost::throw_exception(boost::lock_error()); |
171 | 171 | } |
172 | 172 | m->unlock(); |
173 | 173 | is_locked=false; |
… |
… |
|
323 | 323 | { |
324 | 324 | if(owns_lock()) |
325 | 325 | { |
326 | | throw boost::lock_error(); |
| 326 | boost::throw_exception(boost::lock_error()); |
327 | 327 | } |
328 | 328 | m->lock_shared(); |
329 | 329 | is_locked=true; |
… |
… |
|
332 | 332 | { |
333 | 333 | if(owns_lock()) |
334 | 334 | { |
335 | | throw boost::lock_error(); |
| 335 | boost::throw_exception(boost::lock_error()); |
336 | 336 | } |
337 | 337 | is_locked=m->try_lock_shared(); |
338 | 338 | return is_locked; |
… |
… |
|
341 | 341 | { |
342 | 342 | if(owns_lock()) |
343 | 343 | { |
344 | | throw boost::lock_error(); |
| 344 | boost::throw_exception(boost::lock_error()); |
345 | 345 | } |
346 | 346 | is_locked=m->timed_lock_shared(target_time); |
347 | 347 | return is_locked; |
… |
… |
|
350 | 350 | { |
351 | 351 | if(!owns_lock()) |
352 | 352 | { |
353 | | throw boost::lock_error(); |
| 353 | boost::throw_exception(boost::lock_error()); |
354 | 354 | } |
355 | 355 | m->unlock_shared(); |
356 | 356 | is_locked=false; |
… |
… |
|
466 | 466 | { |
467 | 467 | if(owns_lock()) |
468 | 468 | { |
469 | | throw boost::lock_error(); |
| 469 | boost::throw_exception(boost::lock_error()); |
470 | 470 | } |
471 | 471 | m->lock_upgrade(); |
472 | 472 | is_locked=true; |
… |
… |
|
475 | 475 | { |
476 | 476 | if(owns_lock()) |
477 | 477 | { |
478 | | throw boost::lock_error(); |
| 478 | boost::throw_exception(boost::lock_error()); |
479 | 479 | } |
480 | 480 | is_locked=m->try_lock_upgrade(); |
481 | 481 | return is_locked; |
… |
… |
|
484 | 484 | { |
485 | 485 | if(!owns_lock()) |
486 | 486 | { |
487 | | throw boost::lock_error(); |
| 487 | boost::throw_exception(boost::lock_error()); |
488 | 488 | } |
489 | 489 | m->unlock_upgrade(); |
490 | 490 | is_locked=false; |
diff -r 510d5bd079ad boost/thread/pthread/condition_variable.hpp
a
|
b
|
|
7 | 7 | |
8 | 8 | #include <limits.h> |
9 | 9 | #include <boost/assert.hpp> |
| 10 | #include <boost/throw_exception.hpp> |
10 | 11 | #include <algorithm> |
11 | 12 | #include <pthread.h> |
12 | 13 | #include "timespec.hpp" |
… |
… |
|
21 | 22 | int const res=pthread_cond_init(&cond,NULL); |
22 | 23 | if(res) |
23 | 24 | { |
24 | | throw thread_resource_error(); |
| 25 | boost::throw_exception(thread_resource_error()); |
25 | 26 | } |
26 | 27 | } |
27 | 28 | inline condition_variable::~condition_variable() |
… |
… |
|
72 | 73 | int const res=pthread_mutex_init(&internal_mutex,NULL); |
73 | 74 | if(res) |
74 | 75 | { |
75 | | throw thread_resource_error(); |
| 76 | boost::throw_exception(thread_resource_error()); |
76 | 77 | } |
77 | 78 | int const res2=pthread_cond_init(&cond,NULL); |
78 | 79 | if(res2) |
79 | 80 | { |
80 | 81 | BOOST_VERIFY(!pthread_mutex_destroy(&internal_mutex)); |
81 | | throw thread_resource_error(); |
| 82 | boost::throw_exception(thread_resource_error()); |
82 | 83 | } |
83 | 84 | } |
84 | 85 | ~condition_variable_any() |
… |
… |
|
102 | 103 | } |
103 | 104 | if(res) |
104 | 105 | { |
105 | | throw condition_error(); |
| 106 | boost::throw_exception(condition_error()); |
106 | 107 | } |
107 | 108 | } |
108 | 109 | |
… |
… |
|
132 | 133 | } |
133 | 134 | if(res) |
134 | 135 | { |
135 | | throw condition_error(); |
| 136 | boost::throw_exception(condition_error()); |
136 | 137 | } |
137 | 138 | return true; |
138 | 139 | } |
diff -r 510d5bd079ad boost/thread/pthread/mutex.hpp
a
|
b
|
|
7 | 7 | |
8 | 8 | #include <pthread.h> |
9 | 9 | #include <boost/utility.hpp> |
| 10 | #include <boost/throw_exception.hpp> |
10 | 11 | #include <boost/thread/exceptions.hpp> |
11 | 12 | #include <boost/thread/locks.hpp> |
12 | 13 | #include <boost/thread/thread_time.hpp> |
… |
… |
|
37 | 38 | int const res=pthread_mutex_init(&m,NULL); |
38 | 39 | if(res) |
39 | 40 | { |
40 | | throw thread_resource_error(); |
| 41 | boost::throw_exception(thread_resource_error()); |
41 | 42 | } |
42 | 43 | } |
43 | 44 | ~mutex() |
… |
… |
|
89 | 90 | int const res=pthread_mutex_init(&m,NULL); |
90 | 91 | if(res) |
91 | 92 | { |
92 | | throw thread_resource_error(); |
| 93 | boost::throw_exception(thread_resource_error()); |
93 | 94 | } |
94 | 95 | #ifndef BOOST_PTHREAD_HAS_TIMEDLOCK |
95 | 96 | int const res2=pthread_cond_init(&cond,NULL); |
96 | 97 | if(res2) |
97 | 98 | { |
98 | 99 | BOOST_VERIFY(!pthread_mutex_destroy(&m)); |
99 | | throw thread_resource_error(); |
| 100 | boost::throw_exception(thread_resource_error()); |
100 | 101 | } |
101 | 102 | is_locked=false; |
102 | 103 | #endif |
diff -r 510d5bd079ad boost/thread/pthread/once.hpp
a
|
b
|
|
10 | 10 | // http://www.boost.org/LICENSE_1_0.txt) |
11 | 11 | |
12 | 12 | #include <boost/thread/detail/config.hpp> |
| 13 | #include <boost/config.hpp> |
13 | 14 | |
14 | 15 | #include <pthread.h> |
15 | 16 | #include <boost/assert.hpp> |
… |
… |
|
55 | 56 | if(flag.epoch==uninitialized_flag) |
56 | 57 | { |
57 | 58 | flag.epoch=being_initialized; |
| 59 | #ifndef BOOST_NO_EXCEPTIONS |
58 | 60 | try |
59 | 61 | { |
| 62 | #endif |
60 | 63 | pthread::pthread_mutex_scoped_unlock relocker(&detail::once_epoch_mutex); |
61 | 64 | f(); |
| 65 | #ifndef BOOST_NO_EXCEPTIONS |
62 | 66 | } |
63 | 67 | catch(...) |
64 | 68 | { |
… |
… |
|
66 | 70 | BOOST_VERIFY(!pthread_cond_broadcast(&detail::once_epoch_cv)); |
67 | 71 | throw; |
68 | 72 | } |
| 73 | #endif |
69 | 74 | flag.epoch=--detail::once_global_epoch; |
70 | 75 | BOOST_VERIFY(!pthread_cond_broadcast(&detail::once_epoch_cv)); |
71 | 76 | } |
diff -r 510d5bd079ad boost/thread/pthread/recursive_mutex.hpp
a
|
b
|
|
7 | 7 | |
8 | 8 | #include <pthread.h> |
9 | 9 | #include <boost/utility.hpp> |
| 10 | #include <boost/throw_exception.hpp> |
10 | 11 | #include <boost/thread/exceptions.hpp> |
11 | 12 | #include <boost/thread/locks.hpp> |
12 | 13 | #include <boost/thread/thread_time.hpp> |
… |
… |
|
40 | 41 | int const init_attr_res=pthread_mutexattr_init(&attr); |
41 | 42 | if(init_attr_res) |
42 | 43 | { |
43 | | throw thread_resource_error(); |
| 44 | boost::throw_exception(thread_resource_error()); |
44 | 45 | } |
45 | 46 | int const set_attr_res=pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE); |
46 | 47 | if(set_attr_res) |
47 | 48 | { |
48 | | throw thread_resource_error(); |
| 49 | boost::throw_exception(thread_resource_error()); |
49 | 50 | } |
50 | 51 | |
51 | 52 | int const res=pthread_mutex_init(&m,&attr); |
52 | 53 | if(res) |
53 | 54 | { |
54 | | throw thread_resource_error(); |
| 55 | boost::throw_exception(thread_resource_error()); |
55 | 56 | } |
56 | 57 | BOOST_VERIFY(!pthread_mutexattr_destroy(&attr)); |
57 | 58 | } |
… |
… |
|
102 | 103 | int const init_attr_res=pthread_mutexattr_init(&attr); |
103 | 104 | if(init_attr_res) |
104 | 105 | { |
105 | | throw thread_resource_error(); |
| 106 | boost::throw_exception(thread_resource_error()); |
106 | 107 | } |
107 | 108 | int const set_attr_res=pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE); |
108 | 109 | if(set_attr_res) |
109 | 110 | { |
110 | | throw thread_resource_error(); |
| 111 | boost::throw_exception(thread_resource_error()); |
111 | 112 | } |
112 | 113 | |
113 | 114 | int const res=pthread_mutex_init(&m,&attr); |
114 | 115 | if(res) |
115 | 116 | { |
116 | 117 | BOOST_VERIFY(!pthread_mutexattr_destroy(&attr)); |
117 | | throw thread_resource_error(); |
| 118 | boost::throw_exception(thread_resource_error()); |
118 | 119 | } |
119 | 120 | BOOST_VERIFY(!pthread_mutexattr_destroy(&attr)); |
120 | 121 | #else |
121 | 122 | int const res=pthread_mutex_init(&m,NULL); |
122 | 123 | if(res) |
123 | 124 | { |
124 | | throw thread_resource_error(); |
| 125 | boost::throw_exception(thread_resource_error()); |
125 | 126 | } |
126 | 127 | int const res2=pthread_cond_init(&cond,NULL); |
127 | 128 | if(res2) |
128 | 129 | { |
129 | 130 | BOOST_VERIFY(!pthread_mutex_destroy(&m)); |
130 | | throw thread_resource_error(); |
| 131 | boost::throw_exception(thread_resource_error()); |
131 | 132 | } |
132 | 133 | is_locked=false; |
133 | 134 | count=0; |
diff -r 510d5bd079ad boost/thread/pthread/thread_data.hpp
a
|
b
|
|
10 | 10 | #include <boost/enable_shared_from_this.hpp> |
11 | 11 | #include <boost/thread/mutex.hpp> |
12 | 12 | #include <boost/optional.hpp> |
| 13 | #include <boost/throw_exception.hpp> |
13 | 14 | #include <pthread.h> |
14 | 15 | #include "condition_variable_fwd.hpp" |
15 | 16 | |
16 | 17 | namespace boost |
17 | 18 | { |
18 | | class thread_interrupted |
| 19 | class thread_interrupted : public std::exception |
19 | 20 | {}; |
20 | 21 | |
21 | 22 | namespace detail |
… |
… |
|
68 | 69 | if(thread_info->interrupt_requested) |
69 | 70 | { |
70 | 71 | thread_info->interrupt_requested=false; |
71 | | throw thread_interrupted(); |
| 72 | boost::throw_exception(thread_interrupted()); |
72 | 73 | } |
73 | 74 | } |
74 | 75 | |
diff -r 510d5bd079ad libs/thread/src/pthread/thread.cpp
a
|
b
|
|
13 | 13 | #include <boost/thread/locks.hpp> |
14 | 14 | #include <boost/thread/once.hpp> |
15 | 15 | #include <boost/thread/tss.hpp> |
| 16 | #include <boost/throw_exception.hpp> |
16 | 17 | #ifdef __linux__ |
17 | 18 | #include <sys/sysinfo.h> |
18 | 19 | #elif defined(__APPLE__) || defined(__FreeBSD__) |
… |
… |
|
187 | 188 | if (res != 0) |
188 | 189 | { |
189 | 190 | thread_info->self.reset(); |
190 | | throw thread_resource_error(); |
| 191 | boost::throw_exception(thread_resource_error()); |
191 | 192 | } |
192 | 193 | } |
193 | 194 | |
… |
… |
|
491 | 492 | if(thread_info->interrupt_requested) |
492 | 493 | { |
493 | 494 | thread_info->interrupt_requested=false; |
494 | | throw thread_interrupted(); |
| 495 | boost::throw_exception(thread_interrupted()); |
495 | 496 | } |
496 | 497 | } |
497 | 498 | } |