Blob


1 /*
2 * I am too ignorant to know if Cocoa and Libthread
3 * can coexist: if I try to include thread.h, now
4 * that Devdraw uses Cocoa's threads (and timers), it
5 * crashes immediately; when Devdraw was using
6 * proccreate(), it could run a little while before to
7 * crash; the origin of those crashes is hard to
8 * ascertain, because other programs using Libthread
9 * (such as 9term, Acme, Plumber, and Sam) currently
10 * don't run when compiled with Xcode 4.1.
11 */
12 //#define TRY_LIBTHREAD
14 #ifdef TRY_LIBTHREAD
15 #include <thread.h>
16 #else
17 #define QLock DQLock
18 #define qlock dqlock
19 #define qunlock dqunlock
20 #define threadexitsall exits
21 #define threadmain main
23 typedef struct QLock QLock;
25 struct QLock
26 {
27 int init;
28 pthread_mutex_t m;
29 };
31 void qlock(QLock*);
32 void qunlock(QLock*);
33 #endif