lock.h 427 B

123456789101112131415161718192021222324252627282930
  1. #if !defined(_RESEARCH_SOURCE) && !defined(_PLAN9_SOURCE)
  2. This header file is an extension of ANSI/POSIX
  3. #endif
  4. #ifndef __LOCK_H
  5. #define __LOCK_H
  6. #pragma lib "/$M/lib/ape/libap.a"
  7. #include <u.h>
  8. typedef struct
  9. {
  10. long key;
  11. long sem;
  12. } Lock;
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. extern void lock(Lock*);
  17. extern void unlock(Lock*);
  18. extern int canlock(Lock*);
  19. extern int tas(int*);
  20. #ifdef __cplusplus
  21. }
  22. #endif
  23. #endif