Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Aug 2010 13:58:38 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r211876 - head/sbin/hastd
Message-ID:  <201008271358.o7RDwcB4079785@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201008271358.o7RDwcB4079785>