diff options
author | Russ Cox <rsc@swtch.com> | 2020-01-08 20:03:31 -0500 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2020-01-13 16:46:14 -0500 |
commit | ce27d7babdf2ee09ff6d1f8d4a166c2208995774 (patch) | |
tree | af0a32622542ca768cc0446c6287a4f51a7d1c06 /src/cmd/devdraw/cocoa-thread.c | |
parent | db20f89c3286f277945ac4307f789a9980d31bf6 (diff) | |
download | plan9port-ce27d7babdf2ee09ff6d1f8d4a166c2208995774.tar.gz plan9port-ce27d7babdf2ee09ff6d1f8d4a166c2208995774.tar.bz2 plan9port-ce27d7babdf2ee09ff6d1f8d4a166c2208995774.zip |
devdraw: can use libthread directly now on macOS
Diffstat (limited to 'src/cmd/devdraw/cocoa-thread.c')
-rw-r--r-- | src/cmd/devdraw/cocoa-thread.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/src/cmd/devdraw/cocoa-thread.c b/src/cmd/devdraw/cocoa-thread.c deleted file mode 100644 index 92b92d2c..00000000 --- a/src/cmd/devdraw/cocoa-thread.c +++ /dev/null @@ -1,35 +0,0 @@ -#include <u.h> -#include <libc.h> -#include "cocoa-thread.h" - -#ifndef TRY_LIBTHREAD - -static pthread_mutex_t initlock = PTHREAD_MUTEX_INITIALIZER; - -void -qlock(QLock *q) -{ - if(q->init == 0){ - pthread_mutex_lock(&initlock); - if(q->init == 0){ - pthread_mutex_init(&q->m, nil); - q->init = 1; - } - pthread_mutex_unlock(&initlock); - } - pthread_mutex_lock(&q->m); -} - -void -qunlock(QLock *q) -{ - pthread_mutex_unlock(&q->m); -} - -int -threadid(void) -{ - return pthread_mach_thread_np(pthread_self()); -} - -#endif |