54#define pthread_attr_t b8_pthread_attr_t
56typedef b8OsPid pthread_t;
58typedef void *pthread_addr_t;
60typedef pthread_addr_t (*pthread_startroutine_t)(pthread_addr_t);
61typedef pthread_startroutine_t pthread_func_t;
72#define PTHREAD_STACK_MIN (0x200)
74#undef PTHREAD_CREATE_JOINABLE
75#define PTHREAD_CREATE_JOINABLE 0
77#undef PTHREAD_CREATE_DETACHED
78#define PTHREAD_CREATE_DETACHED 1
80#define pthread_equal(t1,t2) ((t1) == (t2))
97 const pthread_attr_t* attr,
98 pthread_startroutine_t startroutine,
330extern int pthread_join(pthread_t thread, pthread_addr_t *value);
OS definitions and system call interfaces for the BEEP-8 system.
int pthread_attr_init(pthread_attr_t *attr)
Initializes a thread attributes object.
Definition pthread.c:62
int pthread_setschedparam(pthread_t thread, int policy, const struct sched_param *param)
Sets the scheduling policy and parameters of the specified thread.
Definition pthread.c:132
int pthread_join(pthread_t thread, pthread_addr_t *value)
Waits for the specified thread to terminate.
Definition pthread.c:218
int pthread_attr_getdetachstate(const pthread_attr_t *attr, int *detachstate)
Gets the detach state attribute from the thread attributes object.
Definition pthread.c:197
int pthread_attr_destroy(pthread_attr_t *attr)
Destroys a thread attributes object.
Definition pthread.c:75
pthread_t pthread_self(void)
Returns the thread identifier of the calling thread.
Definition pthread.c:229
int pthread_attr_setschedparam(pthread_attr_t *attr, const struct sched_param *param)
Sets the scheduling parameters in the thread attributes object.
Definition pthread.c:163
int pthread_create(pthread_t *thread, const pthread_attr_t *attr, pthread_startroutine_t startroutine, pthread_addr_t arg)
Creates a new thread.
Definition pthread.c:24
int pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy)
Sets the scheduling policy attribute in the thread attributes object.
Definition pthread.c:144
int pthread_detach(pthread_t thread)
Detaches the specified thread.
Definition pthread.c:139
int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize)
Sets the stack size attribute in the thread attributes object.
Definition pthread.c:83
int pthread_cancel(pthread_t thread)
Cancels the specified thread.
Definition pthread.c:213
int pthread_setcanceltype(int type, int *oldtype)
Sets the cancelability type of the calling thread.
int pthread_getschedparam(pthread_t thread, int *policy, struct sched_param *param)
Retrieves the scheduling policy and parameters of the specified thread.
Definition pthread.c:125
void pthread_exit(pthread_addr_t value)
Terminates the calling thread.
Definition pthread.c:208
int pthread_attr_getstacksize(const pthread_attr_t *attr, size_t *stacksize)
Gets the stack size attribute from the thread attributes object.
Definition pthread.c:91
int pthread_attr_getstack(const pthread_attr_t *attr, void **stackaddr, long *stacksize)
Gets the stack address and size attributes from the thread attributes object.
Definition pthread.c:116
int pthread_attr_setdetachstate(pthread_attr_t *attr, int detachstate)
Sets the detach state attribute in the thread attributes object.
Definition pthread.c:186
int pthread_attr_setstack(pthread_attr_t *attr, void *stackaddr, long stacksize)
Sets the stack address and size attributes in the thread attributes object.
Definition pthread.c:103
int pthread_yield(void)
Yields the processor to another thread.
Definition pthread.c:224
int pthread_attr_getschedpolicy(const pthread_attr_t *attr, int *policy)
Retrieves the scheduling policy from the thread attributes object.
Definition pthread.c:152
void pthread_testcancel(void)
Creates a cancellation point in the calling thread.
int pthread_attr_getschedparam(const pthread_attr_t *attr, struct sched_param *param)
Retrieves the scheduling parameters from the thread attributes object.
Definition pthread.c:174
Minimal POSIX-compliant scheduling definitions for the BEEP-8 system.