If a thread is cancelled, it may have already consumed a umtx_wake,

check waiter and semphore counter to see if we may wake up next thread.
This commit is contained in:
David Xu 2008-03-11 03:26:47 +00:00
parent 2b71cf8696
commit 150b71918c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=177046

View File

@ -178,6 +178,8 @@ sem_cancel_handler(void *arg)
sem_t *sem = arg;
atomic_add_int(&(*sem)->nwaiters, -1);
if ((*sem)->nwaiters && (*sem)->count)
_thr_umtx_wake(&(*sem)->count, 1);
}
int