summaryrefslogtreecommitdiff
path: root/usr/src/lib/libc/port/threads/pthread.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib/libc/port/threads/pthread.c')
-rw-r--r--usr/src/lib/libc/port/threads/pthread.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/usr/src/lib/libc/port/threads/pthread.c b/usr/src/lib/libc/port/threads/pthread.c
index 34b4b4c73c..dc0123361d 100644
--- a/usr/src/lib/libc/port/threads/pthread.c
+++ b/usr/src/lib/libc/port/threads/pthread.c
@@ -177,6 +177,14 @@ pthread_create(pthread_t *thread, const pthread_attr_t *attr,
return (error);
}
+static void
+_mutex_unlock_wrap(void *ptr)
+{
+ mutex_t *mp = ptr;
+
+ (void) mutex_unlock(mp);
+}
+
/*
* pthread_once: calls given function only once.
* it synchronizes via mutex in pthread_once_t structure
@@ -192,7 +200,7 @@ pthread_once(pthread_once_t *once_control, void (*init_routine)(void))
if (once->once_flag == PTHREAD_ONCE_NOTDONE) {
(void) mutex_lock(&once->mlock);
if (once->once_flag == PTHREAD_ONCE_NOTDONE) {
- pthread_cleanup_push(mutex_unlock, &once->mlock);
+ pthread_cleanup_push(_mutex_unlock_wrap, &once->mlock);
(*init_routine)();
pthread_cleanup_pop(0);
membar_producer();