94 #if !defined (PLIBSYS_H_INSIDE) && !defined (PLIBSYS_COMPILATION) 95 # error "Header files shouldn't be included directly, consider using <plibsys.h> instead." 98 #ifndef PLIBSYS_HEADER_PSEMAPHORE_H 99 #define PLIBSYS_HEADER_PSEMAPHORE_H P_LIB_API pboolean p_semaphore_acquire(PSemaphore *sem, PError **error)
Acquires (P operation) a semaphore.
#define P_END_DECLS
Closes .h file declarations to be exported as C functions, should be always used after P_BEGIN_DECLS...
Creates semaphore, resets to a given value if exists.
Opens an existing semaphore or creates one with a given value.
char pchar
Type for a char.
struct PError_ PError
Opaque data structure for an error object.
P_LIB_API pboolean p_semaphore_release(PSemaphore *sem, PError **error)
Releases (V operation) a semaphore.
signed int pboolean
Type for a bool.
P_LIB_API void p_semaphore_free(PSemaphore *sem)
Frees PSemaphore object.
P_LIB_API PSemaphore * p_semaphore_new(const pchar *name, pint init_val, PSemaphoreAccessMode mode, PError **error)
Creates a new PSemaphore object.
struct PSemaphore_ PSemaphore
Semaphore opaque data structure.
#define P_LIB_API
Exports a symbol from a shared library.
PSemaphoreAccessMode_
Enum with semaphore creation modes.
#define P_BEGIN_DECLS
Starts .h file declarations to be exported as C functions.
enum PSemaphoreAccessMode_ PSemaphoreAccessMode
Enum with semaphore creation modes.
P_LIB_API void p_semaphore_take_ownership(PSemaphore *sem)
Takes ownership of a semaphore.