Author: pjd Date: Fri Aug 27 13:58:38 2010 New Revision: 211876 URL: http://svn.freebsd.org/changeset/base/211876
Log: Add mtx_owned() implementation. MFC after: 2 weeks Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com Modified: head/sbin/hastd/synch.h Modified: head/sbin/hastd/synch.h ============================================================================== --- head/sbin/hastd/synch.h Fri Aug 27 13:54:17 2010 (r211875) +++ head/sbin/hastd/synch.h Fri Aug 27 13:58:38 2010 (r211876) @@ -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) _______________________________________________ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"