summaryrefslogtreecommitdiff
path: root/src/thread/pthread_cond_signal.c
blob: e8ed71cc6a1f6a7c140501c994841cbcb1e2f28a (plain) (blame)
1
2
3
4
5
6
7
8
9
#include "pthread_impl.h"

int pthread_cond_signal(pthread_cond_t *c)
{
	int w = c->_c_waiters;
	if (a_swap(&c->_c_block, 0) || w)
		__wake(&c->_c_block, 1, 0);
	return 0;
}