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 
9 #pragma once
10 
19 #include <time.h>
20 #include "mutex.h"
21 #include "priority_queue.h"
22 
23 #if defined(__WITH_AVRLIBC__)
24 /* avr-libc 'time.h' does not include 'sys/types.h' but we need 'clockid_t' */
25 # include <sys/types.h>
26 #endif
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
35 typedef struct {
37  int __dummy;
39 
45 typedef struct {
48 
55 
62 
70 int pthread_condattr_getpshared(const pthread_condattr_t *attr, int *pshared);
71 
80 
88 int pthread_condattr_getclock(const pthread_condattr_t *attr, clockid_t *clock_id);
89 
97 int pthread_condattr_setclock(pthread_condattr_t *attr, clockid_t clock_id);
98 
106 
113 
121 
129 int pthread_cond_timedwait(pthread_cond_t *cond, mutex_t *mutex, const struct timespec *abstime);
130 
137 
144 
145 #ifdef __cplusplus
146 }
147 #endif
148 
Mutex for thread synchronization.
A simple priority queue.
int pthread_condattr_getclock(const pthread_condattr_t *attr, clockid_t *clock_id)
Get the clock selected for the condition variable attribute attr.
int pthread_condattr_setpshared(pthread_condattr_t *attr, int pshared)
Set the process-shared attribute in an initialized attributes object referenced by attr.
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_cond_condattr_destroy(pthread_condattr_t *attr)
Uninitializes a condition attribute variable object.
int pthread_cond_destroy(pthread_cond_t *cond)
Destroy the condition variable cond.
int pthread_cond_condattr_init(pthread_condattr_t *attr)
Initializes a condition attribute variable object using default values.
int pthread_condattr_setclock(pthread_condattr_t *attr, clockid_t clock_id)
Set the clock selected for the condition variable attribute ATTR.
int pthread_cond_init(pthread_cond_t *cond, pthread_condattr_t *attr)
Initializes a condition variable object.
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_broadcast(pthread_cond_t *cond)
unblock all threads that are currently blocked on the specified condition variable cond
int pthread_condattr_getpshared(const pthread_condattr_t *attr, int *pshared)
Get the process-shared attribute in an initialized attributes object referenced by attr.
Mutex structure.
Definition: mutex.h:39
data type for priority queues
Condition variable.
Definition: pthread_cond.h:45
priority_queue_t queue
Threads currently waiting to be signaled.
Definition: pthread_cond.h:46
int __dummy
dumdidum
Definition: pthread_cond.h:37