2 #define HEADER_SYNCH_H 1
14 void sema_init (struct semaphore *, unsigned value, const char *);
15 void sema_down (struct semaphore *);
16 void sema_up (struct semaphore *);
17 const char *sema_name (const struct semaphore *);
18 void sema_self_test (void);
23 struct thread *holder;
24 struct semaphore semaphore;
27 void lock_init (struct lock *, const char *);
28 void lock_acquire (struct lock *);
29 void lock_release (struct lock *);
30 bool lock_held_by_current_thread (const struct lock *);
31 const char *lock_name (const struct lock *);
39 void cond_init (struct condition *, const char *);
40 void cond_wait (struct condition *, struct lock *);
41 void cond_signal (struct condition *, struct lock *);
42 void cond_broadcast (struct condition *, struct lock *);
43 const char *cond_name (const struct condition *);