RetroArch
|
#include <retro_common_api.h>
#include <boolean.h>
#include <stdint.h>
#include <retro_inline.h>
#include <retro_miscellaneous.h>
Go to the source code of this file.
Typedefs | |
typedef typedefRETRO_BEGIN_DECLS struct sthread | sthread_t |
typedef struct slock | slock_t |
typedef struct scond | scond_t |
Functions | |
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) |
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 resource sare 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_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.