File: pthread_cond_broadcast.c

package info (click to toggle)
dietlibc 0.34~cvs20160606-10
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 11,336 kB
  • sloc: ansic: 71,631; asm: 13,006; cpp: 1,860; makefile: 799; sh: 292; perl: 62
file content (27 lines) | stat: -rw-r--r-- 500 bytes parent folder | download | duplicates (11)
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;
}