FreeRTOS:
POSIX
|
Return to main page ↑ |
Implementation of condition variable functions in pthread.h. More...
#include <limits.h>
#include "FreeRTOS_POSIX.h"
#include "FreeRTOS_POSIX/errno.h"
#include "FreeRTOS_POSIX/pthread.h"
#include "FreeRTOS_POSIX/utils.h"
#include "atomic.h"
Functions | |
static void | prvInitializeStaticCond (pthread_cond_internal_t *pxCond) |
Initialize a PTHREAD_COND_INITIALIZER cond. More... | |
static void | prvTestAndDecrement (pthread_cond_t *pxCond, unsigned iLocalWaitingThreads) |
Check "atomically" if iLocalWaitingThreads == pxCond->iWaitingThreads and decrement. | |
int | pthread_cond_broadcast (pthread_cond_t *cond) |
Broadcast a condition. More... | |
int | pthread_cond_destroy (pthread_cond_t *cond) |
Destroy condition variables. More... | |
int | pthread_cond_init (pthread_cond_t *cond, const pthread_condattr_t *attr) |
Initialize condition variables. More... | |
int | pthread_cond_signal (pthread_cond_t *cond) |
Signal a condition. More... | |
int | pthread_cond_timedwait (pthread_cond_t *cond, pthread_mutex_t *mutex, const struct timespec *abstime) |
Wait on a condition with a timeout. More... | |
int | pthread_cond_wait (pthread_cond_t *cond, pthread_mutex_t *mutex) |
Wait on a condition. More... | |
Implementation of condition variable functions in pthread.h.
|
static |
Initialize a PTHREAD_COND_INITIALIZER cond.
PTHREAD_COND_INITIALIZER sets a flag for a cond to be initialized later. This function performs the initialization.
[in] | pxCond | The cond to initialize. |
int pthread_cond_broadcast | ( | pthread_cond_t * | cond | ) |
Broadcast a condition.
0 | - Upon successful completion. |
int pthread_cond_destroy | ( | pthread_cond_t * | cond | ) |
Destroy condition variables.
0 | - Upon successful completion. |
int pthread_cond_init | ( | pthread_cond_t * | cond, |
const pthread_condattr_t * | attr | ||
) |
Initialize condition variables.
0 | - Upon successful completion. |
ENOMEM | - Insufficient memory exists to initialize the condition variable. |
int pthread_cond_signal | ( | pthread_cond_t * | cond | ) |
Signal a condition.
0 | - Upon successful completion. |
int pthread_cond_timedwait | ( | pthread_cond_t * | cond, |
pthread_mutex_t * | mutex, | ||
const struct timespec * | abstime | ||
) |
Wait on a condition with a timeout.
0 | - Upon successful completion. |
EINVAL | - The abstime argument passed in does not refer to an initialized structure OR the abstime parameter specified a nanoseconds field value less than zero or greater than or equal to 1000 million. |
ETIMEDOUT | - The time specified by abstime to pthread_cond_timedwait() has passed. |
int pthread_cond_wait | ( | pthread_cond_t * | cond, |
pthread_mutex_t * | mutex | ||
) |
Wait on a condition.
0 | - Upon successful completion. |