Add pthread_mutex_isowned_np() here as well; libthr and libkse are supposed

to have identical functionality.

MFC after:	2 weeks
This commit is contained in:
Dag-Erling Smørgrav 2008-02-06 20:44:29 +00:00
parent d29b081fee
commit 0957bb7d29
2 changed files with 15 additions and 0 deletions

View File

@ -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;
};

View File

@ -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);
}