RetroArch
|
#include <stdlib.h>
#include <string.h>
#include <boolean.h>
#include <rthreads/rthreads.h>
#include <pthread.h>
#include <time.h>
Classes | |
struct | thread_data |
struct | sthread |
struct | slock |
struct | scond |
Macros | |
#define | HAVE_THREAD_ATTR |
Functions | |
static void * | thread_wrap (void *data_) |
sthread_t * | sthread_create (void(*thread_func)(void *), void *userdata) |
sthread_t * | sthread_create_with_priority (void(*thread_func)(void *), void *userdata, int thread_priority) |
int | sthread_detach (sthread_t *thread) |
void | sthread_join (sthread_t *thread) |
bool | sthread_isself (sthread_t *thread) |
slock_t * | slock_new (void) |
void | slock_free (slock_t *lock) |
void | slock_lock (slock_t *lock) |
void | slock_unlock (slock_t *lock) |
scond_t * | scond_new (void) |
#define HAVE_THREAD_ATTR |
scond_new:
Creates and initializes a condition variable. Must be manually freed.
Returns: pointer to new condition variable on success, otherwise NULL.
slock_free: : pointer to mutex object
Frees a mutex.
slock_lock: : pointer to mutex object
Locks a mutex. If a mutex is already locked by another thread, the calling thread shall block until the mutex becomes available.
slock_new:
Create and initialize a new mutex. Must be manually freed.
Returns: pointer to a new mutex if successful, otherwise NULL.
slock_unlock: : pointer to mutex object
Unlocks a mutex.
sthread_create: : thread entry callback function : pointer to userdata that will be made available in thread entry callback function
Create a new thread.
Returns: pointer to new thread if successful, otherwise NULL.
sthread_t* sthread_create_with_priority | ( | void(*)(void *) | thread_func, |
void * | userdata, | ||
int | thread_priority | ||
) |
sthread_create_with_priority: : thread entry callback function : pointer to userdata that will be made available in thread entry callback function : thread priority hint value from [1-100]
Create a new thread. It is possible for the caller to give a hint for the thread's priority from [1-100]. Any passed in values that are outside of this range will cause sthread_create() to create a new thread using the operating system's default thread priority.
Returns: pointer to new thread if successful, otherwise NULL.
int sthread_detach | ( | sthread_t * | thread | ) |
sthread_detach: : pointer to thread object
Detach a thread. When a detached thread terminates, its resources are automatically released back to the system without the need for another thread to join with the terminated thread.
Returns: 0 on success, otherwise it returns a non-zero error number.
sthread_isself: : pointer to thread object
Returns: true (1) if calling thread is the specified thread
sthread_join: : pointer to thread object
Join with a terminated thread. Waits for the thread specified by to terminate. If that thread has already terminated, then it will return immediately. The thread specified by must be joinable.
Returns: 0 on success, otherwise it returns a non-zero error number.