X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fsem_post.c;h=8f4700c3058a4735516a5ae94330fb59df004234;hb=eb0e8fa0b1960cff4bd65ebefc798f70273b0bc9;hp=0bd8a4621116bba5f49c9e70478ce856adb88239;hpb=6fc5fdbdc70dd17ea8e681a361fb4dae541ee953;p=musl diff --git a/src/thread/sem_post.c b/src/thread/sem_post.c index 0bd8a462..8f4700c3 100644 --- a/src/thread/sem_post.c +++ b/src/thread/sem_post.c @@ -3,7 +3,8 @@ 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; }