The friendly Operating System for the Internet of Things
pthread_cond.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Hamburg University of Applied Sciences (HAW)
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
17 #ifndef SYS__POSIX__PTHREAD_COND__H
18 #define SYS__POSIX__PTHREAD_COND__H
19 
20 #include <time.h>
21 #include "mutex.h"
22 #include "priority_queue.h"
23 
24 #if defined(CPU_CC430) || defined(CPU_MSP430FXYZ)
25 # include "msp430_types.h"
26 #endif
27 
28 #if defined(__MACH__) || defined(__WITH_AVRLIBC__)
29 typedef int clockid_t;
30 #endif
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
39 typedef struct {
41  int __dummy;
43 
49 typedef struct {
52 
59 
66 
74 int pthread_condattr_getpshared(const pthread_condattr_t *attr, int *pshared);
75 
83 int pthread_condattr_setpshared(pthread_condattr_t *attr, int pshared);
84 
92 int pthread_condattr_getclock(const pthread_condattr_t *attr, clockid_t *clock_id);
93 
101 int pthread_condattr_setclock(pthread_condattr_t *attr, clockid_t clock_id);
102 
110 
117 
124 int pthread_cond_wait(pthread_cond_t *cond, mutex_t *mutex);
125 
133 int pthread_cond_timedwait(pthread_cond_t *cond, mutex_t *mutex, const struct timespec *abstime);
134 
141 
148 
149 #ifdef __cplusplus
150 }
151 #endif
152 
153 #endif /* SYS__POSIX__PTHREAD_COND__H */
154 
int __dummy
dumdidum
Definition: pthread_cond.h:41
int pthread_cond_init(pthread_cond_t *cond, pthread_condattr_t *attr)
Initializes a condition variable object.
int pthread_condattr_getclock(const pthread_condattr_t *attr, clockid_t *clock_id)
Get the clock selected for the conditon variable attribute attr.
data type for priority queues
Condition variable.
Definition: pthread_cond.h:49
A simple priority queue.
int pthread_cond_broadcast(pthread_cond_t *cond)
unblock all threads that are currently blocked on the specified condition variable cond ...
int pthread_cond_condattr_init(pthread_condattr_t *attr)
Initializes a condition attribute variable object using default values.
RIOT synchronization API.
int pthread_condattr_getpshared(const pthread_condattr_t *attr, int *pshared)
Get the process-shared attribute in an initialised attributes object referenced by attr...
priority_queue_t queue
Threads currently waiting to be signaled.
Definition: pthread_cond.h:50
int pthread_condattr_setpshared(pthread_condattr_t *attr, int pshared)
Set the process-shared attribute in an initialised attributes object referenced by attr...
Mutex structure.
Definition: mutex.h:36
Definition of struct timespec for the MSP430.
Definition: msp430_types.h:50
int pthread_cond_timedwait(pthread_cond_t *cond, mutex_t *mutex, const struct timespec *abstime)
blocks the calling thread until the specified condition cond is signalled
int pthread_cond_wait(pthread_cond_t *cond, mutex_t *mutex)
blocks the calling thread until the specified condition cond is signalled
int pthread_cond_destroy(pthread_cond_t *cond)
Destroy the condition variable cond.
int pthread_cond_condattr_destroy(pthread_condattr_t *attr)
Uninitializes a condition attribute variable object.
int pthread_cond_signal(pthread_cond_t *cond)
unblock at least one of the threads that are blocked on the specified condition variable cond ...
int pthread_condattr_setclock(pthread_condattr_t *attr, clockid_t clock_id)
Set the clock selected for the conditon variable attribute ATTR.