Add mtx_owned() implementation.
MFC after: 2 weeks Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
This commit is contained in:
parent
29f3bd82d2
commit
ef9c1a15b4
@ -33,7 +33,9 @@
|
||||
#define _SYNCH_H_
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <pthread.h>
|
||||
#include <pthread_np.h>
|
||||
#include <stdbool.h>
|
||||
#include <time.h>
|
||||
|
||||
@ -70,6 +72,12 @@ mtx_unlock(pthread_mutex_t *lock)
|
||||
error = pthread_mutex_unlock(lock);
|
||||
assert(error == 0);
|
||||
}
|
||||
static __inline bool
|
||||
mtx_owned(pthread_mutex_t *lock)
|
||||
{
|
||||
|
||||
return (pthread_mutex_isowned_np(lock) != 0);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
rw_init(pthread_rwlock_t *lock)
|
||||
|
Loading…
x
Reference in New Issue
Block a user