Loading...
Searching...
No Matches
pthread_cond.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2014 HAW Hamburg
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
15
16#include <time.h>
17#include "mutex.h"
18#include "priority_queue.h"
19
20#if defined(__WITH_AVRLIBC__)
21/* avr-libc 'time.h' does not include 'sys/types.h' but we need 'clockid_t' */
22# include <sys/types.h>
23#endif
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
32typedef struct {
36
45
52
59
67int pthread_condattr_getpshared(const pthread_condattr_t *attr, int *pshared);
68
77
85int pthread_condattr_getclock(const pthread_condattr_t *attr, clockid_t *clock_id);
86
94int pthread_condattr_setclock(pthread_condattr_t *attr, clockid_t clock_id);
95
103
110
118
126int pthread_cond_timedwait(pthread_cond_t *cond, mutex_t *mutex, const struct timespec *abstime);
127
134
141
142#ifdef __cplusplus
143}
144#endif
145
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:36
data type for priority queues
Condition variable.
priority_queue_t queue
Threads currently waiting to be signaled.
int __dummy
dumdidum