diff options
author | des <des@FreeBSD.org> | 2008-02-06 20:44:29 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2008-02-06 20:44:29 +0000 |
commit | b4e1ea3e1cc947e4e8afdce157a35e5fa08e8276 (patch) | |
tree | cd761a22f566e8654681656a33953ed7ca00e0a5 /lib | |
parent | f006d1f25ab3059ec5549d936da38874a1a96b5a (diff) | |
download | FreeBSD-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')
-rw-r--r-- | lib/libkse/kse.map | 5 | ||||
-rw-r--r-- | lib/libkse/thread/thr_mutex.c | 10 |
2 files changed, 15 insertions, 0 deletions
diff --git a/lib/libkse/kse.map b/lib/libkse/kse.map index 94f6dd9..a6eed69 100644 --- a/lib/libkse/kse.map +++ b/lib/libkse/kse.map @@ -256,6 +256,7 @@ FBSDprivate_1.0 { _pthread_mutex_getprioceiling; _pthread_mutex_init; _pthread_mutex_init_calloc_cb; + _pthread_mutex_isowned_np; _pthread_mutex_lock; _pthread_mutex_setprioceiling; _pthread_mutex_timedlock; @@ -360,3 +361,7 @@ FBSDprivate_1.0 { _thread_state_running; _thread_state_zoombie; }; + +FBSD_1.1 { + pthread_mutex_isowned_np; +}; 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); +} + |