PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
|
Provides API for implementation of pthread functions. More...
#include <sys/thread.h>
#include <sys/size_t.h>
#include <sys/null.h>
#include <setjmp.h>
#include <propeller.h>
Go to the source code of this file.
Classes | |
struct | pthread_attr_t |
The pthread_attr_t struct TODO. More... | |
struct | pthread_mutex_t |
The pthread_mutex_t TODO. More... | |
struct | pthread_cond_t |
Condition variables. More... | |
Macros | |
#define | _CACHE_SIZE_NEEDED (0) |
#define | PTHREAD_STACK_MIN (64 + _CACHE_SIZE_NEEDED) |
Minimum stack size for a thread. | |
#define | _PTHREAD_STACK_DEFAULT (512 + _CACHE_SIZE_NEEDED) |
Default stack size for a thread. | |
#define | _PTHREAD_DETACHED 0x0001 |
Detached flag for the pthread "flags" field. | |
#define | _PTHREAD_TERMINATED 0x8000 |
Terminated flag for the pthread "flags" field. | |
#define | PTHREAD_CREATE_JOINABLE 0 |
#define | PTHREAD_CREATE_DETACHED 1 |
#define | PTHREAD_MUTEX_INITIALIZER { 0, 0 } |
#define | __lock_pthreads() __lock(&__pthreads_lock) |
#define | __unlock_pthreads() __unlock(&__pthreads_lock) |
#define | PTHREAD_KEYS_MAX _THREAD_KEYS_MAX |
Maximum number of keys for per-thread data. | |
#define | PTHREAD_ONCE_INIT 0 |
#define | _pthread_ptr(thread) (thread) |
#define | _pthread_self() _TLS |
#define | pthread_set_cog_affinity_np(thread, mask) do { thread->affinity = ~(mask); } while (0) |
#define | pthread_set_affinity_thiscog_np() pthread_set_cog_affinity_np(_TLS, __this_cpu_mask()) |
#define | __atomic_thread_fence(x) |
Typedefs | |
typedef _thread_state_t | _pthread_state_t |
typedef _thread_queue_t | _pthread_queue_t |
typedef _pthread_state_t * | pthread_t |
The pthread_t typedef is used as the "handle" for threads and functions. | |
typedef struct pthread_attr_t | pthread_attr_t |
The pthread_attr_t struct TODO. | |
typedef struct pthread_mutex_t | pthread_mutex_t |
The pthread_mutex_t TODO. | |
typedef int | pthread_mutexattr_t |
Mutex attributes are not implemented. | |
typedef struct pthread_cond_t | pthread_cond_t |
Condition variables. | |
typedef int | pthread_condattr_t |
Condition variable attributes are not implemented. | |
typedef void(* | __pthread_destruct_func) (void *) |
Destructor function associated with thread specific data. | |
typedef unsigned char | pthread_key_t |
Type for per-thread data keys. | |
typedef atomic_t | pthread_once_t |
Type for pthread_once function (runs a function just once) | |
Functions | |
void | _pthread_sleep (_pthread_queue_t *queue) |
void | _pthread_sleep_with_lock (_pthread_queue_t *queue) |
int | _pthread_wake (_pthread_queue_t *queue) |
int | _pthread_wakeall (_pthread_queue_t *queue) |
void | _pthread_free (_pthread_state_t *thr) |
int | pthread_attr_init (pthread_attr_t *attr) |
int | pthread_attr_destroy (pthread_attr_t *attr) |
int | pthread_attr_getdetachstate (pthread_attr_t *attr, int *detachstate) |
int | pthread_attr_getstacksize (pthread_attr_t *attr, size_t *stacksize) |
int | pthread_attr_setstacksize (pthread_attr_t *attr, size_t stacksize) |
int | pthread_attr_setdetachstate (pthread_attr_t *attr, int detachstate) |
int | pthread_attr_setstackaddr (pthread_attr_t *attr, void *stackaddr) |
int | pthread_create (pthread_t *thread, const pthread_attr_t *attr, void *(startfunc)(void *), void *arg) |
void | pthread_exit (void *) |
int | pthread_join (pthread_t thread, void **result_ptr) |
int | pthread_detach (pthread_t thread) |
int | pthread_mutex_init (pthread_mutex_t *mutex, const pthread_mutexattr_t *attr) |
int | pthread_mutex_lock (pthread_mutex_t *mutex) |
int | pthread_mutex_trylock (pthread_mutex_t *mutex) |
int | pthread_mutex_unlock (pthread_mutex_t *mutex) |
int | pthread_mutex_destroy (pthread_mutex_t *mutex) |
int | pthread_cond_init (pthread_cond_t *cond, const pthread_condattr_t *attr) |
int | pthread_cond_destroy (pthread_cond_t *cond) |
int | pthread_cond_signal (pthread_cond_t *cond) |
int | pthread_cond_broadcast (pthread_cond_t *cond) |
int | pthread_cond_wait (pthread_cond_t *cond, pthread_mutex_t *mutex) |
int | pthread_key_create (pthread_key_t *key, void(*destructor)(void *)) |
int | pthread_key_delete (pthread_key_t key) |
void * | pthread_getspecific (pthread_key_t k) |
int | pthread_setspecific (pthread_key_t k, void *val) |
void | pthread_yield (void) |
void | sched_yield (void) |
pthread_t | pthread_self (void) |
int | pthread_once (pthread_once_t *once_control, void(*init_routine)(void)) |
void | pthread_set_cog_affinity_np (pthread_t *thread, unsigned short cogmask) |
Variables | |
HUBDATA atomic_t | __pthreads_lock |
Lock for pthreads data structures. | |
__pthread_destruct_func | __pdestruct [PTHREAD_KEYS_MAX] |
Table of destructors for thread specific data. | |
Provides API for implementation of pthread functions.
POSIX threads are a set of functions that support applications with requirements for multiple flows of control, called threads, within a process. Multithreading is used to improve the performance of a program.
The pthread module provides a subset of the POSIX standard pthread library for allowing multiple threads to run on multiple COG instances of the PropellerGCC LMM or XMM interpreter.
Definition in file pthread.h.
struct pthread_attr_t |
The pthread_attr_t struct TODO.
Class Members | ||
---|---|---|
unsigned int | flags | flags to start with |
void * | stack | pointer to base of stack, NULL to allocate one |
size_t | stksiz | stack size |
struct pthread_mutex_t |
The pthread_mutex_t TODO.
Class Members | ||
---|---|---|
atomic_t | cnt | |
_pthread_queue_t | queue |