summaryrefslogtreecommitdiff
path: root/Xthreads.h
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-25 19:28:01 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-25 19:28:01 +0000
commit376f9efdab6ef2dce267caa0a0228892e768e390 (patch)
treed58ca14843514adcd7308067019ecf47adb553e7 /Xthreads.h
parent5ec315b967cb1ae519f514896f0b48fb5407f863 (diff)
XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks
Diffstat (limited to 'Xthreads.h')
-rw-r--r--Xthreads.h34
1 files changed, 33 insertions, 1 deletions
diff --git a/Xthreads.h b/Xthreads.h
index f2e87a1..0bc6558 100644
--- a/Xthreads.h
+++ b/Xthreads.h
@@ -25,7 +25,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
* *
*/
-/* $XFree86: xc/include/Xthreads.h,v 3.10 2001/12/14 19:53:26 dawes Exp $ */
+/* $XFree86: xc/include/Xthreads.h,v 3.11 2003/03/08 19:14:53 herrb Exp $ */
#ifndef _XTHREADS_H_
#define _XTHREADS_H_
@@ -196,6 +196,37 @@ typedef pthread_mutex_t xmutex_rec;
#define xcondition_signal(c) tis_cond_signal(c)
#define xcondition_broadcast(c) tis_cond_broadcast(c)
#else
+#ifdef USE_NBSD_THREADLIB
+/*
+ * NetBSD threadlib support is intended for thread safe libraries.
+ * This should not be used for general client programming.
+ */
+#include <threadlib.h>
+typedef thr_t xthread_t;
+typedef thread_key_t xthread_key_t;
+typedef cond_t xcondition_rec;
+typedef mutex_t xmutex_rec;
+#define xthread_self thr_self
+#define xthread_fork(func,closure) { thr_t _tmpxthr; \
+ /* XXX Create it detached? --thorpej */ \
+ thr_create(&_tmpxthr,NULL,func,closure); }
+#define xthread_yield() thr_yield()
+#define xthread_exit(v) thr_exit(v)
+#define xthread_key_create(kp,d) thr_keycreate(kp,d)
+#define xthread_key_delete(k) thr_keydelete(k)
+#define xthread_set_specific(k,v) thr_setspecific(k,v)
+#define xthread_get_specific(k,vp) *(vp) = thr_getspecific(k)
+#define XMUTEX_INITIALIZER MUTEX_INITIALIZER
+#define xmutex_init(m) mutex_init(m, 0)
+#define xmutex_clear(m) mutex_destroy(m)
+#define xmutex_lock(m) mutex_lock(m)
+#define xmutex_unlock(m) mutex_unlock(m)
+#define xcondition_init(c) cond_init(c, 0, 0)
+#define xcondition_clear(c) cond_destroy(c)
+#define xcondition_wait(c,m) cond_wait(c,m)
+#define xcondition_signal(c) cond_signal(c)
+#define xcondition_broadcast(c) cond_broadcast(c)
+#else
#include <pthread.h>
typedef pthread_t xthread_t;
typedef pthread_key_t xthread_key_t;
@@ -248,6 +279,7 @@ static xthread_t _X_no_thread_id;
#define xcondition_set_name(cv,str) ((char**)(cv)->field1)[5] = (str)
#endif /* DEBUG */
#endif /* _CMA_VENDOR_ == _CMA__IBM */
+#endif /* USE_NBSD_THREADLIB */
#endif /* USE_TIS_SUPPORT */
#endif /* WIN32 */
#endif /* SVR4 */