Commit 77d93d70 authored by Martin Hurton's avatar Martin Hurton

Simplify use of posix_assert in mutex.hpp

It is the job of the posix_assert macro to check
the value. No need to do it twice.

The patch also fixes some whitespace problems.
parent e7674025
...@@ -81,28 +81,24 @@ namespace zmq ...@@ -81,28 +81,24 @@ namespace zmq
inline mutex_t () inline mutex_t ()
{ {
int rc = pthread_mutex_init (&mutex, NULL); int rc = pthread_mutex_init (&mutex, NULL);
if (rc)
posix_assert (rc); posix_assert (rc);
} }
inline ~mutex_t () inline ~mutex_t ()
{ {
int rc = pthread_mutex_destroy (&mutex); int rc = pthread_mutex_destroy (&mutex);
if (rc)
posix_assert (rc); posix_assert (rc);
} }
inline void lock () inline void lock ()
{ {
int rc = pthread_mutex_lock (&mutex); int rc = pthread_mutex_lock (&mutex);
if (rc)
posix_assert (rc); posix_assert (rc);
} }
inline void unlock () inline void unlock ()
{ {
int rc = pthread_mutex_unlock (&mutex); int rc = pthread_mutex_unlock (&mutex);
if (rc)
posix_assert (rc); posix_assert (rc);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment