1 #ifndef _PLAN9_SOURCE 2 This header file is an extension to ANSI/POSIX 3 #endif 4 5 #ifndef __QLOCK_H_ 6 #define __QLOCK_H_ 7 #pragma lib "/$M/lib/ape/lib9.a" 8 9 #include <u.h> 10 #include <lock.h> 11 12 typedef struct QLp QLp; 13 struct QLp 14 { 15 int inuse; 16 QLp *next; 17 char state; 18 }; 19 20 typedef 21 struct QLock 22 { 23 Lock lock; 24 int locked; 25 QLp *head; 26 QLp *tail; 27 } QLock; 28 29 #ifdef __cplusplus 30 extern "C" { 31 #endif 32 33 extern void qlock(QLock*); 34 extern void qunlock(QLock*); 35 extern int canqlock(QLock*); 36 37 #ifdef __cplusplus 38 } 39 #endif 40 41 #endif 42