Threading API. More...
#include <razorback/visibility.h>#include <razorback/types.h>#include <razorback/lock.h>#include <razorback/api.h>#include <pthread.h>

Go to the source code of this file.
Data Structures | |
| struct | Thread |
| Thread Purpose: hold the information about a thread. More... | |
Typedefs | |
| typedef pthread_t | rzb_thread_t |
Functions | |
| SO_PUBLIC struct Thread * | Thread_Launch (void(*function)(struct Thread *), void *userData, char *name, struct RazorbackContext *context) |
| Create a new thread. | |
| SO_PUBLIC struct RazorbackContext * | Thread_ChangeContext (struct Thread *thread, struct RazorbackContext *context) |
| Change the registered context of a running thread. | |
| SO_PUBLIC struct RazorbackContext * | Thread_GetContext (struct Thread *p_pThread) |
| Get the registered context of a running thread. | |
| SO_PUBLIC struct RazorbackContext * | Thread_GetCurrentContext (void) |
| Get the running context for the current thread. | |
| SO_PUBLIC void | Thread_Destroy (struct Thread *thread) |
| Destroy a threads data. | |
| SO_PUBLIC bool | Thread_IsRunning (struct Thread *thread) |
| Checks whether a thread is running or not. | |
| SO_PUBLIC bool | Thread_IsStopped (struct Thread *thread) |
| Check if a thread has finished. | |
| SO_PUBLIC void | Thread_Join (struct Thread *thread) |
| Suspend execution of the calling thread until the target thread therminates. | |
| SO_PUBLIC void | Thread_Interrupt (struct Thread *thread) |
| Interrupt the target thread. | |
| SO_PUBLIC void | Thread_Stop (struct Thread *thread) |
| Stop the target thread. | |
| SO_PUBLIC void | Thread_StopAndJoin (struct Thread *thread) |
| SO_PUBLIC void | Thread_InterruptAndJoin (struct Thread *thread) |
| SO_PUBLIC void | Thread_Yield (void) |
| Cause the current thread to yield execution to other runnable threads. | |
| SO_PUBLIC uint32_t | Thread_getCount (void) |
| Get the number of currently running threads. | |
| SO_PUBLIC struct Thread * | Thread_GetCurrent (void) |
| Get the current thread. | |
| SO_PUBLIC rzb_thread_t | Thread_GetCurrentId (void) |
| Get the current thread ID. | |
| SO_PUBLIC int | Thread_KeyCmp (void *a, void *id) |
| SO_PUBLIC int | Thread_Cmp (void *a, void *b) |
Threading API.
| SO_PUBLIC struct RazorbackContext* Thread_ChangeContext | ( | struct Thread * | thread, | |
| struct RazorbackContext * | context | |||
| ) | [read] |
Change the registered context of a running thread.
| thread | the thread to change | |
| context | the new context |
| SO_PUBLIC void Thread_Destroy | ( | struct Thread * | thread | ) |
Destroy a threads data.
| *thread | The thread to destroy |
| SO_PUBLIC struct RazorbackContext* Thread_GetContext | ( | struct Thread * | p_pThread | ) | [read] |
Get the registered context of a running thread.
| thread | the thread to change |
| SO_PUBLIC uint32_t Thread_getCount | ( | void | ) |
Get the number of currently running threads.
| SO_PUBLIC struct RazorbackContext* Thread_GetCurrentContext | ( | void | ) | [read] |
Get the running context for the current thread.
| SO_PUBLIC void Thread_Interrupt | ( | struct Thread * | thread | ) |
Interrupt the target thread.
| thread | The target thread. |
| SO_PUBLIC bool Thread_IsRunning | ( | struct Thread * | thread | ) |
Checks whether a thread is running or not.
| *thread | The thread the test |
| SO_PUBLIC bool Thread_IsStopped | ( | struct Thread * | thread | ) |
Check if a thread has finished.
| thread | The thread to test. |
| SO_PUBLIC void Thread_Join | ( | struct Thread * | thread | ) |
Suspend execution of the calling thread until the target thread therminates.
| thread | The target thread. |
| SO_PUBLIC struct Thread* Thread_Launch | ( | void(*)(struct Thread *) | function, | |
| void * | userData, | |||
| char * | name, | |||
| struct RazorbackContext * | context | |||
| ) | [read] |
Create a new thread.
| *function | The function the thread will execute | |
| *userData | The thread user data | |
| *name | The name of the thread | |
| *context | The initial context of the thread |
| SO_PUBLIC void Thread_Stop | ( | struct Thread * | thread | ) |
Stop the target thread.
| thread | The target thread. |
1.6.3