$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
From: Roland Schwarz (roland.schwarz_at_[hidden])
Date: 2005-09-15 09:07:44
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