clang-format
This commit is contained in:
@@ -34,7 +34,6 @@
|
||||
* Header file for synchronization primitives.
|
||||
*/
|
||||
|
||||
|
||||
#include <spinlock.h>
|
||||
|
||||
/*
|
||||
@@ -44,10 +43,10 @@
|
||||
* internally.
|
||||
*/
|
||||
struct semaphore {
|
||||
char *sem_name;
|
||||
struct wchan *sem_wchan;
|
||||
struct spinlock sem_lock;
|
||||
volatile unsigned sem_count;
|
||||
char *sem_name;
|
||||
struct wchan *sem_wchan;
|
||||
struct spinlock sem_lock;
|
||||
volatile unsigned sem_count;
|
||||
};
|
||||
|
||||
struct semaphore *sem_create(const char *name, unsigned initial_count);
|
||||
@@ -62,7 +61,6 @@ void sem_destroy(struct semaphore *);
|
||||
void P(struct semaphore *);
|
||||
void V(struct semaphore *);
|
||||
|
||||
|
||||
/*
|
||||
* Simple lock for mutual exclusion.
|
||||
*
|
||||
@@ -73,10 +71,10 @@ void V(struct semaphore *);
|
||||
* (should be) made internally.
|
||||
*/
|
||||
struct lock {
|
||||
char *lk_name;
|
||||
HANGMAN_LOCKABLE(lk_hangman); /* Deadlock detector hook. */
|
||||
// add what you need here
|
||||
// (don't forget to mark things volatile as needed)
|
||||
char *lk_name;
|
||||
HANGMAN_LOCKABLE(lk_hangman); /* Deadlock detector hook. */
|
||||
// add what you need here
|
||||
// (don't forget to mark things volatile as needed)
|
||||
};
|
||||
|
||||
struct lock *lock_create(const char *name);
|
||||
@@ -97,7 +95,6 @@ void lock_acquire(struct lock *);
|
||||
void lock_release(struct lock *);
|
||||
bool lock_do_i_hold(struct lock *);
|
||||
|
||||
|
||||
/*
|
||||
* Condition variable.
|
||||
*
|
||||
@@ -113,9 +110,9 @@ bool lock_do_i_hold(struct lock *);
|
||||
*/
|
||||
|
||||
struct cv {
|
||||
char *cv_name;
|
||||
// add what you need here
|
||||
// (don't forget to mark things volatile as needed)
|
||||
char *cv_name;
|
||||
// add what you need here
|
||||
// (don't forget to mark things volatile as needed)
|
||||
};
|
||||
|
||||
struct cv *cv_create(const char *name);
|
||||
@@ -138,5 +135,4 @@ void cv_wait(struct cv *cv, struct lock *lock);
|
||||
void cv_signal(struct cv *cv, struct lock *lock);
|
||||
void cv_broadcast(struct cv *cv, struct lock *lock);
|
||||
|
||||
|
||||
#endif /* _SYNCH_H_ */
|
||||
|
||||
Reference in New Issue
Block a user