projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
optimize compound-literal sigset_t's not to contain useless hurd bits
[musl]
/
src
/
thread
/
sem_post.c
diff --git
a/src/thread/sem_post.c
b/src/thread/sem_post.c
index
0bd8a46
..
8f4700c
100644
(file)
--- a/
src/thread/sem_post.c
+++ b/
src/thread/sem_post.c
@@
-3,7
+3,8
@@
int sem_post(sem_t *sem)
{
int sem_post(sem_t *sem)
{
- if (!a_fetch_add(sem->__val, 1))
+ a_inc(sem->__val);
+ if (sem->__val[1])
__wake(sem->__val, 1, 0);
return 0;
}
__wake(sem->__val, 1, 0);
return 0;
}