diff -uprN boost_1_55_0.orig/boost/asio/detail/impl/task_io_service.ipp boost_1_55_0.patch/boost/asio/detail/impl/task_io_service.ipp
|
old
|
new
|
struct task_io_service::work_cleanup
|
| 77 | 77 | { |
| 78 | 78 | lock_->lock(); |
| 79 | 79 | task_io_service_->op_queue_.push(this_thread_->private_op_queue); |
| | 80 | lock_->unlock(); |
| 80 | 81 | } |
| 81 | 82 | #endif // defined(BOOST_ASIO_HAS_THREADS) |
| | 83 | |
| | 84 | // If the last handler put a new work into the empty queue |
| | 85 | // we should wake up a thread for it |
| | 86 | if(check_new_handlers_) |
| | 87 | { |
| | 88 | lock_->lock(); |
| | 89 | if(!task_io_service_->op_queue_.empty()) |
| | 90 | task_io_service_->wake_one_thread_and_unlock(*lock_); |
| | 91 | else |
| | 92 | lock_->unlock(); |
| | 93 | } |
| 82 | 94 | } |
| 83 | 95 | |
| 84 | 96 | task_io_service* task_io_service_; |
| 85 | 97 | mutex::scoped_lock* lock_; |
| 86 | 98 | thread_info* this_thread_; |
| | 99 | bool check_new_handlers_; |
| 87 | 100 | }; |
| 88 | 101 | |
| 89 | 102 | task_io_service::task_io_service( |
| … |
… |
std::size_t task_io_service::do_run_one(
|
| 377 | 390 | lock.unlock(); |
| 378 | 391 | |
| 379 | 392 | // Ensure the count of outstanding work is decremented on block exit. |
| 380 | | work_cleanup on_exit = { this, &lock, &this_thread }; |
| | 393 | work_cleanup on_exit = { this, &lock, &this_thread, !one_thread_ }; |
| 381 | 394 | (void)on_exit; |
| 382 | 395 | |
| 383 | 396 | // Complete the operation. May throw an exception. Deletes the object. |
diff -uprN boost_1_55_0.orig/boost/asio/detail/posix_event.hpp boost_1_55_0.patch/boost/asio/detail/posix_event.hpp
|
old
|
new
|
public:
|
| 58 | 58 | { |
| 59 | 59 | BOOST_ASIO_ASSERT(lock.locked()); |
| 60 | 60 | signalled_ = true; |
| 61 | | lock.unlock(); |
| 62 | 61 | ::pthread_cond_signal(&cond_); // Ignore EINVAL. |
| | 62 | lock.unlock(); |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | // Reset the event. |