Rizin
unix-like reverse engineering framework and cli tools
|
#include "thread.h"
Go to the source code of this file.
Functions | |
RZ_API RZ_OWN RzThreadCond * | rz_th_cond_new (void) |
Condition variables are intended to be used to communicate changes in the state of data shared between threads. Condition variables are always associated with a mutex to provide synchronized access to the shared data. More... | |
RZ_API void | rz_th_cond_signal (RZ_NONNULL RzThreadCond *cond) |
This function shall unblock at least one of the threads that are blocked on the specified condition. More... | |
RZ_API void | rz_th_cond_signal_all (RZ_NONNULL RzThreadCond *cond) |
This function shall unblock all threads currently blocked on the specified condition. More... | |
RZ_API void | rz_th_cond_wait (RZ_NONNULL RzThreadCond *cond, RZ_NONNULL RzThreadLock *lock) |
The function shall block on a condition variable and shall be called with RzThreadLock locked by the calling thread. More... | |
RZ_API void | rz_th_cond_free (RZ_NULLABLE RzThreadCond *cond) |
Frees a RzThreadCond struct. More... | |
RZ_API void rz_th_cond_free | ( | RZ_NULLABLE RzThreadCond * | cond | ) |
Frees a RzThreadCond struct.
cond | The RzThreadCond to free |
Definition at line 77 of file thread_cond.c.
Referenced by rz_test_main(), rz_th_queue_free(), and task_free().
RZ_API RZ_OWN RzThreadCond* rz_th_cond_new | ( | void | ) |
Condition variables are intended to be used to communicate changes in the state of data shared between threads. Condition variables are always associated with a mutex to provide synchronized access to the shared data.
Definition at line 13 of file thread_cond.c.
References cond, free(), NULL, and RZ_NEW0.
Referenced by rz_core_task_new(), rz_test_main(), and rz_th_queue_new().
RZ_API void rz_th_cond_signal | ( | RZ_NONNULL RzThreadCond * | cond | ) |
This function shall unblock at least one of the threads that are blocked on the specified condition.
cond | The RzThreadCond to use for signalling a waiting thread |
Definition at line 34 of file thread_cond.c.
References cond, and rz_return_if_fail.
Referenced by rz_core_task_schedule(), rz_th_queue_push(), and worker_th().
RZ_API void rz_th_cond_signal_all | ( | RZ_NONNULL RzThreadCond * | cond | ) |
This function shall unblock all threads currently blocked on the specified condition.
cond | The RzThreadCond to use for signalling all waiting threads |
Definition at line 48 of file thread_cond.c.
References cond, and rz_return_if_fail.
RZ_API void rz_th_cond_wait | ( | RZ_NONNULL RzThreadCond * | cond, |
RZ_NONNULL RzThreadLock * | lock | ||
) |
The function shall block on a condition variable and shall be called with RzThreadLock locked by the calling thread.
cond | The RzThreadCond to use for waiting the signal |
lock | The RzThreadLock lock to use (the lock must be already taken by the thread) |
Definition at line 63 of file thread_cond.c.
References cond, lock(), and rz_return_if_fail.
Referenced by rz_core_task_schedule(), rz_test_main(), rz_th_queue_wait_pop(), and task_wakeup().