Monado OpenXR Runtime
Loading...
Searching...
No Matches
os_thread_helper Struct Reference

All in one helper that handles locking, waiting for change and starting a thread. More...

#include <os/os_threading.h>

Collaboration diagram for os_thread_helper:

Static Public Member Functions

static int os_thread_helper_init (struct os_thread_helper *oth)
 Initialize the thread helper.
 
static int os_thread_helper_start (struct os_thread_helper *oth, os_run_func_t func, void *ptr)
 Start the internal thread.
 
static int os_thread_helper_signal_stop (struct os_thread_helper *oth)
 Signal from within the thread that we are stopping.
 
static int os_thread_helper_stop_and_wait (struct os_thread_helper *oth)
 Stop the thread and wait for it to exit.
 
static void os_thread_helper_destroy (struct os_thread_helper *oth)
 Destroy the thread helper, externally synchronizable.
 
static void os_thread_helper_lock (struct os_thread_helper *oth)
 Lock the helper.
 
static void os_thread_helper_unlock (struct os_thread_helper *oth)
 Unlock the helper.
 
static bool os_thread_helper_is_running (struct os_thread_helper *oth)
 Is the thread running, or supposed to be running.
 
static bool os_thread_helper_is_running_locked (struct os_thread_helper *oth)
 Is the thread running, or supposed to be running.
 
static void os_thread_helper_wait_locked (struct os_thread_helper *oth)
 Wait for a signal.
 
static void os_thread_helper_signal_locked (struct os_thread_helper *oth)
 Signal a waiting thread to wake up.
 
static void os_thread_helper_name (struct os_thread_helper *oth, const char *name)
 Make a best effort to name our thread.
 

Data Fields

pthread_t thread
 
pthread_mutex_t mutex
 
pthread_cond_t cond
 
bool initialized
 
bool running
 

Detailed Description

All in one helper that handles locking, waiting for change and starting a thread.


The documentation for this struct was generated from the following file: