12#ifndef __METAL_CONDITION__H__
13#error "Include metal/condition.h instead of metal/nuttx/condition.h"
16#ifndef __METAL_NUTTX_CONDITION__H__
17#define __METAL_NUTTX_CONDITION__H__
30#define METAL_CONDITION_INIT {PTHREAD_COND_INITIALIZER}
34 pthread_cond_init(&cv->
cond, NULL);
39 return -pthread_cond_signal(&cv->
cond);
44 return -pthread_cond_broadcast(&cv->
cond);
static int metal_condition_signal(struct metal_condition *cv)
Notify one waiter. Before calling this function, the caller should have acquired the mutex.
static int metal_condition_broadcast(struct metal_condition *cv)
Notify all waiters. Before calling this function, the caller should have acquired the mutex.
static void metal_condition_init(struct metal_condition *cv)
Initialize a libmetal condition variable.