24#ifndef _UTILS_IPC_SEMSET_H_
25#define _UTILS_IPC_SEMSET_H_
29class SemaphoreSetData;
47 void lock(
unsigned short sem_num = 0,
short num = 1);
48 bool try_lock(
unsigned short sem_num = 0,
short num = 1);
49 void unlock(
unsigned short sem_num = 0,
short num = -1);
62 SemaphoreSetData *data;
bool destroy_on_delete
Destroy this semaphore on delete?
void set_destroy_on_delete(bool destroy)
Set if semaphore set should be destroyed on delete.
bool valid()
Check if the semaphore set is valid.
void unlock(unsigned short sem_num=0, short num=-1)
Unlock resources on the semaphore set.
int get_value(int sem_num)
Get the semaphore value.
bool try_lock(unsigned short sem_num=0, short num=1)
Try to lock resources on the semaphore set.
void lock(unsigned short sem_num=0, short num=1)
Lock resources on the semaphore set.
SemaphoreSet(const char *path, char id, int num_sems, bool create=false, bool destroy_on_delete=false)
Constructor.
~SemaphoreSet()
Destructor.
int key()
Get key of semaphore.
static void destroy(int key)
Destroy a semaphore set.
static int free_key()
Get a non-zero free key Scans the key space sequentially until a non-zero unused key is found.
void set_value(int sem_num, int val)
Set the semaphore value.
Fawkes library namespace.