Re: How to wait for multiple threads simultaneously?



On Feb 13, 1:51 am, Rainer Weikusat <rweiku...@xxxxxxxxxxx> wrote:

You can then spin on that condition variable.

To 'spin' on some lock would mean to busy-wait until it is free, eg

while (try_to_take(&lock) == FAILED);

Right, but a condition variable is not a lock. To 'spin' on a
condition variable means to block on it until the predicate occurs,
like

while(!predicate) pthread_cond_wait(...);

DS
.