reduce the size of ppage by 8 bytes using signly linked list
[lunaix-os.git] / lunaix-os / includes / lunaix / ds / semaphore.h
index e202d141afdb6481db16cb5e0a4c979a349c86ea..aa7045f4559262eeb6aa5943b78ff2e33145fcb2 100644 (file)
@@ -3,15 +3,19 @@
 
 #include <stdatomic.h>
 
-struct sem_t {
-    _Atomic unsigned int counter;
+struct sem_t
+{
+    atomic_ulong counter;
     // 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 */