diff options
author | Martin Hurton <hurtonm@gmail.com> | 2009-08-31 11:31:32 +0200 |
---|---|---|
committer | Martin Hurton <hurtonm@gmail.com> | 2009-08-31 13:31:01 +0200 |
commit | 0aacee389fdb553ef9925d0135eefcb501a67726 (patch) | |
tree | 33e5bd2a58eabe4f5a8a2cdbe1f11b5147ef7490 /src/simple_semaphore.hpp | |
parent | 72fdf47d16c8d3ecd9da657b4649978e414d775c (diff) |
POSIX threads don't use errno to report errors
Fix simple_semaphore to follow POSIX threads convention for reporting
errors.
Diffstat (limited to 'src/simple_semaphore.hpp')
-rw-r--r-- | src/simple_semaphore.hpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/simple_semaphore.hpp b/src/simple_semaphore.hpp index b48a7f5..209ccb4 100644 --- a/src/simple_semaphore.hpp +++ b/src/simple_semaphore.hpp @@ -53,32 +53,32 @@ namespace zmq inline simple_semaphore_t () { int rc = pthread_mutex_init (&mutex, NULL); - errno_assert (rc == 0); + posix_assert (rc); rc = pthread_mutex_lock (&mutex); - errno_assert (rc == 0); + posix_assert (rc); } // Destroy the semaphore. inline ~simple_semaphore_t () { int rc = pthread_mutex_unlock (&mutex); - errno_assert (rc == 0); + posix_assert (rc); rc = pthread_mutex_destroy (&mutex); - errno_assert (rc == 0); + posix_assert (rc); } // Wait for the semaphore. inline void wait () { int rc = pthread_mutex_lock (&mutex); - errno_assert (rc == 0); + posix_assert (rc); } // Post the semaphore. inline void post () { int rc = pthread_mutex_unlock (&mutex); - errno_assert (rc == 0); + posix_assert (rc); } private: |