|
Paraslash Audio Streaming |
About News Download Documentation Development |
Functions | |
int | mutex_new (void) |
int | mutex_destroy (int id) |
void | mutex_lock (int id) |
void | mutex_unlock (int id) |
int | shm_new (size_t size) |
int | shm_destroy (int id) |
int | shm_attach (int id, enum shm_attach_mode mode, void **result) |
int | shm_size (int id, size_t *result) |
int | shm_detach (void *addr) |
size_t | shm_get_shmmax (void) |
int mutex_new | ( | void | ) |
Define a new mutex.
References ERRNO_TO_PARA_ERROR.
int mutex_destroy | ( | int | id | ) |
Destroy a mutex.
id | The identifier of the mutex to be destroyed. |
References ERRNO_TO_PARA_ERROR.
void mutex_lock | ( | int | id | ) |
Lock the given mutex.
id | The identifier of the shared memory area to lock. |
This function either succeeds or aborts.
void mutex_unlock | ( | int | id | ) |
Unlock a mutex.
id | The identifier of the mutex. |
This function either succeeds or aborts.
int shm_new | ( | size_t | size | ) |
Create a new shared memory area of given size.
size | The size of the shared memory area to create. |
References ERRNO_TO_PARA_ERROR.
Referenced by pass_buffer_as_shm(), and send_callback_request().
int shm_destroy | ( | int | id | ) |
Destroy the given shared memory area.
id | The shared memory identifier. |
References ERRNO_TO_PARA_ERROR.
Referenced by pass_buffer_as_shm().
int shm_attach | ( | int | id, |
enum shm_attach_mode | mode, | ||
void ** | result | ||
) |
Attach a shared memory segment.
id | The identifier of the shared memory segment to attach. |
mode | Either ATTACH_RO (read only) or ATTACH_RW (read/write). |
result | Points to the attached area just attached on success. |
References ATTACH_RW, and ERRNO_TO_PARA_ERROR.
Referenced by load_afd(), pass_buffer_as_shm(), and send_callback_request().
int shm_size | ( | int | id, |
size_t * | result | ||
) |
Get the size of a shared memory segment.
id | The shared memory segment identifier. |
result | Size in bytes is returned here, zero on errors. |
References ERRNO_TO_PARA_ERROR.
Referenced by load_afd().
int shm_detach | ( | void * | addr | ) |
Detach a shared memory segment.
addr | The address of the attached segment. |
References ERRNO_TO_PARA_ERROR.
Referenced by pass_buffer_as_shm(), and send_callback_request().
size_t shm_get_shmmax | ( | void | ) |
Get the maximal size of a shared memory area.
The value is only computed once when the function is called for the first time. Subsequent calls return the number which was computed during the first call.
References PARA_INFO_LOG, and PARA_WARNING_LOG.