summaryrefslogtreecommitdiff
path: root/usr/src/lib/libc/port/threads/pthread.c
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2018-07-02 22:44:37 +0300
committerHans Rosenfeld <hans.rosenfeld@joyent.com>2019-01-04 13:35:22 +0100
commitadc04c2d55dd20cc6a0622f1147c0b084cdc3099 (patch)
tree5444b9de7cd9c0bf36bbd9ef11e313e5d07b4e69 /usr/src/lib/libc/port/threads/pthread.c
parent9419bc2fc61b54b25a4e45211d31fcb920ff67cc (diff)
downloadillumos-gate-adc04c2d55dd20cc6a0622f1147c0b084cdc3099.tar.gz
10159 libc: cast between incompatible function types
Reviewed by: Gergő Mihály Doma <domag02@gmail.com> Reviewed by: C Fraire <cfraire@me.com> Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
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();