diff options
author | pjd <pjd@FreeBSD.org> | 2010-08-27 13:58:38 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2010-08-27 13:58:38 +0000 |
commit | ef9c1a15b49a0653d04723f72c64106743e0b463 (patch) | |
tree | 0c133d405287de8cc179b621961071a331655412 /sbin/hastd | |
parent | 29f3bd82d29fa25814dbedfc9d97c0def90b2ddc (diff) | |
download | FreeBSD-src-ef9c1a15b49a0653d04723f72c64106743e0b463.zip FreeBSD-src-ef9c1a15b49a0653d04723f72c64106743e0b463.tar.gz |
Add mtx_owned() implementation.
MFC after: 2 weeks
Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com
Diffstat (limited to 'sbin/hastd')
-rw-r--r-- | sbin/hastd/synch.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sbin/hastd/synch.h b/sbin/hastd/synch.h index 7269aea..006b0e7 100644 --- a/sbin/hastd/synch.h +++ b/sbin/hastd/synch.h @@ -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) |