git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
reduce the size of ppage by 8 bytes using signly linked list
[lunaix-os.git]
/
lunaix-os
/
includes
/
lunaix
/
ds
/
semaphore.h
diff --git
a/lunaix-os/includes/lunaix/ds/semaphore.h
b/lunaix-os/includes/lunaix/ds/semaphore.h
index e202d141afdb6481db16cb5e0a4c979a349c86ea..aa7045f4559262eeb6aa5943b78ff2e33145fcb2 100644
(file)
--- a/
lunaix-os/includes/lunaix/ds/semaphore.h
+++ b/
lunaix-os/includes/lunaix/ds/semaphore.h
@@
-3,15
+3,19
@@
#include <stdatomic.h>
#include <stdatomic.h>
-struct sem_t {
- _Atomic unsigned int counter;
+struct sem_t
+{
+ atomic_ulong counter;
// FUTURE: might need a waiting list
};
// FUTURE: might need a waiting list
};
-void sem_init(struct sem_t *sem, unsigned int initial);
+void
+sem_init(struct sem_t* sem, unsigned int initial);
-void sem_wait(struct sem_t *sem);
+void
+sem_wait(struct sem_t* sem);
-void sem_post(struct sem_t *sem);
+void
+sem_post(struct sem_t* sem);
#endif /* __LUNAIX_SEMAPHORE_H */
#endif /* __LUNAIX_SEMAPHORE_H */