summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/libpthread/pthread_cond_signal.c
blob: 60bf2119c2150e0d5aa394a1f1419d2436b7a768 (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
#include <unistd.h>
#include <errno.h>

#include <pthread.h>
#include "thread_internal.h"

int pthread_cond_signal(pthread_cond_t *cond)
{
  _pthread_descr tmp=0;

  __THREAD_INIT();

  __pthread_lock(&(cond->lock));
  if ((tmp=cond->wait_chain)) cond->wait_chain=tmp->waitnext;
  __pthread_unlock(&(cond->lock));

  if (tmp) {
    tmp->waitnext=0;
    tmp->waiting=0;
  }

  return 0;
}