From ce27d7babdf2ee09ff6d1f8d4a166c2208995774 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 8 Jan 2020 20:03:31 -0500 Subject: devdraw: can use libthread directly now on macOS --- src/cmd/devdraw/cocoa-thread.c | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 src/cmd/devdraw/cocoa-thread.c (limited to 'src/cmd/devdraw/cocoa-thread.c') 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 -#include -#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 -- cgit v1.2.3