
15 Sep
2005
15 Sep
'05
2:07 p.m.
Roland Schwarz wrote:
4) a signal arrives, while gate still is closed Now is 0 < nWaitersToUnblock < N, correct? But 0 == nWaitersBlocked the signal results in a NO-OP and consequently the waiter from 3) will never get it to see - hence it is lost ??
Replacing the seuence on entry to wait: sem_Wait (semBlockLock); nWaitersBlocked++; sem_post(semBlockLock); by atomic_increment(nWaitersBlocked); sem_Wait (semBlockLock); sem_Wait (semBlockLock); would avoid loosing this signal, since the signal(bAll) function would increment nWaitersToUnblock then. Roland