1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-29 12:03:03 +00:00

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:
Pawel Jakub Dawidek 2010-08-27 13:58:38 +00:00
parent 7087d13fae
commit 6e5f008ac4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=211876

View File

@ -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)