Rizin
unix-like reverse engineering framework and cli tools
|
#include "thread.h"
Go to the source code of this file.
Macros | |
#define | RZ_SEM_NAMED_ONLY 0 |
Functions | |
RZ_API RZ_OWN RzThreadSemaphore * | rz_th_sem_new (unsigned int initial) |
Allocates and initialize a RzThreadSemaphore structure. More... | |
RZ_API void | rz_th_sem_free (RZ_NULLABLE RzThreadSemaphore *sem) |
Frees a RzThreadSemaphore struct. More... | |
RZ_API void | rz_th_sem_post (RZ_NONNULL RzThreadSemaphore *sem) |
increments (releases) a semaphore More... | |
RZ_API void | rz_th_sem_wait (RZ_NONNULL RzThreadSemaphore *sem) |
Decrements (acquires) the semaphore (waits indefinetely) More... | |
#define RZ_SEM_NAMED_ONLY 0 |
Definition at line 11 of file thread_sem.c.
RZ_API void rz_th_sem_free | ( | RZ_NULLABLE RzThreadSemaphore * | sem | ) |
Frees a RzThreadSemaphore struct.
sem | The RzThreadSemaphore to free |
Definition at line 73 of file thread_sem.c.
References free(), and sem_destroy().
Referenced by task_free().
RZ_API RZ_OWN RzThreadSemaphore* rz_th_sem_new | ( | unsigned int | initial | ) |
Allocates and initialize a RzThreadSemaphore structure.
initial | The initial status of the semaphore |
Definition at line 26 of file thread_sem.c.
References free(), LONG, malloc(), NULL, O_CREAT, O_EXCL, RZ_NEW, rz_th_sem_t::sem, sem_init(), and ST32_MAX.
Referenced by rz_core_task_enqueue().
RZ_API void rz_th_sem_post | ( | RZ_NONNULL RzThreadSemaphore * | sem | ) |
increments (releases) a semaphore
sem | The RzThreadSemaphore to increment (release) |
Definition at line 97 of file thread_sem.c.
References NULL, rz_return_if_fail, and sem_post().
Referenced by task_join(), and task_run_thread().
RZ_API void rz_th_sem_wait | ( | RZ_NONNULL RzThreadSemaphore * | sem | ) |
Decrements (acquires) the semaphore (waits indefinetely)
sem | The RzThreadSemaphore to decrement (acquire) |
Definition at line 111 of file thread_sem.c.
References rz_return_if_fail, and sem_wait().
Referenced by rz_core_task_enqueue(), and task_join().