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
Support to multi-threading and pthread interface (POSIX.1-2008) (#23)
[lunaix-os.git]
/
lunaix-os
/
kernel
/
ds
/
semaphore.c
diff --git
a/lunaix-os/kernel/ds/semaphore.c
b/lunaix-os/kernel/ds/semaphore.c
index ab494d2f3c810469e82d7bfa4bf7e126f576ba2d..b02266c0574c8918824852790911188a597752e4 100644
(file)
--- a/
lunaix-os/kernel/ds/semaphore.c
+++ b/
lunaix-os/kernel/ds/semaphore.c
@@
-11,7
+11,8
@@
void
sem_wait(struct sem_t* sem)
{
while (!atomic_load(&sem->counter)) {
- schedule();
+ // FIXME: better thing like wait queue
+ sched_pass();
}
atomic_fetch_sub(&sem->counter, 1);
}