|
PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
|
Go to the documentation of this file.
33 #include <sys/thread.h>
34 #include <sys/size_t.h>
39 #if defined(__PROPELLER_USE_XMM__)
40 #define _CACHE_SIZE_NEEDED (1024+128+16)
42 #define _CACHE_SIZE_NEEDED (0)
46 #define PTHREAD_STACK_MIN (64 + _CACHE_SIZE_NEEDED)
48 #define _PTHREAD_STACK_DEFAULT (512 + _CACHE_SIZE_NEEDED)
51 #define _PTHREAD_DETACHED 0x0001
53 #define _PTHREAD_TERMINATED 0x8000
55 #define PTHREAD_CREATE_JOINABLE 0
56 #define PTHREAD_CREATE_DETACHED 1
60 typedef _thread_queue_t _pthread_queue_t;
85 _pthread_queue_t queue;
88 #define PTHREAD_MUTEX_INITIALIZER { 0, 0 }
95 #define __lock_pthreads() __lock(&__pthreads_lock)
96 #define __unlock_pthreads() __unlock(&__pthreads_lock)
100 _pthread_queue_t queue;
110 #define PTHREAD_KEYS_MAX _THREAD_KEYS_MAX
120 #define PTHREAD_ONCE_INIT 0
125 void _pthread_sleep(_pthread_queue_t *queue);
126 void _pthread_sleep_with_lock(_pthread_queue_t *queue);
127 int _pthread_wake(_pthread_queue_t *queue);
128 int _pthread_wakeall(_pthread_queue_t *queue);
134 #define _pthread_ptr(thread) (thread)
135 #define _pthread_self() _TLS
143 int pthread_attr_getdetachstate(
pthread_attr_t *attr,
int *detachstate);
144 int pthread_attr_getstacksize(
pthread_attr_t *attr,
size_t *stacksize);
145 int pthread_attr_setstacksize(
pthread_attr_t *attr,
size_t stacksize);
146 int pthread_attr_setdetachstate(
pthread_attr_t *attr,
int detachstate);
147 int pthread_attr_setstackaddr(
pthread_attr_t *attr,
void *stackaddr);
154 void *(startfunc)(
void*),
void *arg);
155 void pthread_exit(
void *);
156 int pthread_join(
pthread_t thread,
void **result_ptr);
171 int pthread_key_create(
pthread_key_t *key,
void (*destructor)(
void *));
176 void pthread_yield(
void);
177 void sched_yield(
void);
180 int pthread_once(
pthread_once_t *once_control,
void (*init_routine)(
void));
187 void pthread_set_cog_affinity_np(
pthread_t *thread,
unsigned short cogmask);
190 void pthread_set_affinity_thiscog_np(
void);
192 #define pthread_set_cog_affinity_np(thread, mask) \
193 do { thread->affinity = ~(mask); } while (0)
195 #define pthread_set_affinity_thiscog_np() pthread_set_cog_affinity_np(_TLS, __this_cpu_mask())
202 #define __atomic_thread_fence(x)
int pthread_condattr_t
Condition variable attributes are not implemented.
HUBDATA atomic_t __pthreads_lock
Lock for pthreads data structures.
struct pthread_attr_t pthread_attr_t
The pthread_attr_t struct TODO.
int pthread_mutexattr_t
Mutex attributes are not implemented.
unsigned char pthread_key_t
Type for per-thread data keys.
#define PTHREAD_KEYS_MAX
Maximum number of keys for per-thread data.
The pthread_attr_t struct TODO.
atomic_t pthread_once_t
Type for pthread_once function (runs a function just once)
__pthread_destruct_func __pdestruct[PTHREAD_KEYS_MAX]
Table of destructors for thread specific data.
void(* __pthread_destruct_func)(void *)
Destructor function associated with thread specific data.
Provides Propeller specific functions.
struct pthread_mutex_t pthread_mutex_t
The pthread_mutex_t TODO.
#define HUBDATA
HUBDATA tells compiler to put data into HUB RAM section. This is mostly useful in XMM modes where dat...
void * stack
pointer to base of stack, NULL to allocate one
_pthread_state_t * pthread_t
The pthread_t typedef is used as the "handle" for threads and functions.
unsigned int flags
flags to start with
The pthread_mutex_t TODO.
struct pthread_cond_t pthread_cond_t
Condition variables.