blob: 776e0adfc0ce16bf3da71a725fbcbd6376befd7e (
plain)
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
|
#include <unistd.h>
#include <errno.h>
#include <pthread.h>
#include "thread_internal.h"
int pthread_cond_broadcast(pthread_cond_t *cond)
{
_pthread_descr tmp;
__THREAD_INIT();
__NO_ASYNC_CANCEL_BEGIN;
__pthread_lock(&(cond->lock));
for (tmp=cond->wait_chain;tmp;tmp=tmp->waitnext) {
tmp->waitnext=0;
tmp->waiting=0;
}
cond->wait_chain=0;
__pthread_unlock(&(cond->lock));
__NO_ASYNC_CANCEL_STOP;
return 0;
}
|