RetroArch
Classes | Macros | Functions
rthreads.c File Reference
#include <stdlib.h>
#include <string.h>
#include <boolean.h>
#include <rthreads/rthreads.h>
#include <pthread.h>
#include <time.h>
Include dependency graph for rthreads.c:

Classes

struct  thread_data
 
struct  sthread
 
struct  slock
 
struct  scond
 

Macros

#define HAVE_THREAD_ATTR
 

Functions

static voidthread_wrap (void *data_)
 
sthread_tsthread_create (void(*thread_func)(void *), void *userdata)
 
sthread_tsthread_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_tslock_new (void)
 
void slock_free (slock_t *lock)
 
void slock_lock (slock_t *lock)
 
void slock_unlock (slock_t *lock)
 
scond_tscond_new (void)
 

Macro Definition Documentation

◆ HAVE_THREAD_ATTR

#define HAVE_THREAD_ATTR

Function Documentation

◆ scond_new()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ slock_free()

void slock_free ( slock_t lock)

slock_free: : pointer to mutex object

Frees a mutex.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ slock_lock()

void slock_lock ( slock_t lock)

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.

Here is the call graph for this function:

◆ slock_new()

slock_t* slock_new ( void  )

slock_new:

Create and initialize a new mutex. Must be manually freed.

Returns: pointer to a new mutex if successful, otherwise NULL.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ slock_unlock()

void slock_unlock ( slock_t lock)

slock_unlock: : pointer to mutex object

Unlocks a mutex.

Here is the call graph for this function:

◆ sthread_create()

sthread_t* sthread_create ( void(*)(void *)  thread_func,
void userdata 
)

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sthread_create_with_priority()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sthread_detach()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sthread_isself()

bool sthread_isself ( sthread_t thread)

sthread_isself: : pointer to thread object

Returns: true (1) if calling thread is the specified thread

Here is the call graph for this function:

◆ sthread_join()

void sthread_join ( sthread_t 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ thread_wrap()

static void* thread_wrap ( void data_)
static
Here is the call graph for this function:
Here is the caller graph for this function: