summaryrefslogtreecommitdiffstats
path: root/lib/libkse/thread/thr_mutex.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2008-02-06 20:44:29 +0000
committerdes <des@FreeBSD.org>2008-02-06 20:44:29 +0000
commitb4e1ea3e1cc947e4e8afdce157a35e5fa08e8276 (patch)
treecd761a22f566e8654681656a33953ed7ca00e0a5 /lib/libkse/thread/thr_mutex.c
parentf006d1f25ab3059ec5549d936da38874a1a96b5a (diff)
downloadFreeBSD-src-b4e1ea3e1cc947e4e8afdce157a35e5fa08e8276.zip
FreeBSD-src-b4e1ea3e1cc947e4e8afdce157a35e5fa08e8276.tar.gz
Add pthread_mutex_isowned_np() here as well; libthr and libkse are supposed
to have identical functionality. MFC after: 2 weeks
Diffstat (limited to 'lib/libkse/thread/thr_mutex.c')
-rw-r--r--lib/libkse/thread/thr_mutex.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/libkse/thread/thr_mutex.c b/lib/libkse/thread/thr_mutex.c
index f6b0e24..a2a7ed5 100644
--- a/lib/libkse/thread/thr_mutex.c
+++ b/lib/libkse/thread/thr_mutex.c
@@ -110,6 +110,7 @@ __weak_reference(__pthread_mutex_trylock, pthread_mutex_trylock);
/* No difference between libc and application usage of these: */
__weak_reference(_pthread_mutex_destroy, pthread_mutex_destroy);
__weak_reference(_pthread_mutex_unlock, pthread_mutex_unlock);
+__weak_reference(_pthread_mutex_isowned_np, pthread_mutex_isowned_np);
static int
thr_mutex_init(pthread_mutex_t *mutex,
@@ -1849,3 +1850,12 @@ mutex_queue_enq(pthread_mutex_t mutex, pthread_t pthread)
}
pthread->sflags |= THR_FLAGS_IN_SYNCQ;
}
+
+int
+_pthread_mutex_isowned_np(pthread_mutex_t *mutex)
+{
+ struct pthread *curthread = _get_curthread();
+
+ return ((*mutex)->m_owner == curthread);
+}
+
OpenPOWER on IntegriCloud