1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
#include <unistd.h>
#include <errno.h>
#include <pthread.h>
#include "thread_internal.h"
int pthread_cond_broadcast(pthread_cond_t*cond) {
_pthread_descr this=__thread_self();
_pthread_descr tmp,next;
__NO_ASYNC_CANCEL_BEGIN_(this);
LOCK(cond);
for (tmp=cond->wait_chain;tmp;tmp=next) {
next=tmp->waitnext;
__thread_restart(tmp);
tmp->waitnext=0;
tmp->waitprev=&(tmp->waitnext);
}
cond->wait_chain=0;
UNLOCK(cond);
__NO_ASYNC_CANCEL_END_(this);
return 0;
}
|