diff --git a/include/boost/asio/detail/posix_event.hpp b/include/boost/asio/detail/posix_event.hpp index 3b905ba5..69813c8d 100644 --- a/include/boost/asio/detail/posix_event.hpp +++ b/include/boost/asio/detail/posix_event.hpp @@ -66,9 +66,9 @@ class posix_event BOOST_ASIO_ASSERT(lock.locked()); state_ |= 1; bool have_waiters = (state_ > 1); - lock.unlock(); if (have_waiters) ::pthread_cond_signal(&cond_); // Ignore EINVAL. + lock.unlock(); } // If there's a waiter, unlock the mutex and signal it. @@ -79,8 +79,8 @@ class posix_event state_ |= 1; if (state_ > 1) { - lock.unlock(); ::pthread_cond_signal(&cond_); // Ignore EINVAL. + lock.unlock(); return true; } return false;