2 * Copyright 2003-2009, Axel Dörfler, axeld@pinc-software.de.
3 * Copyright 2007, Ryan Leavengood, leavengood@gmail.com.
4 * All rights reserved. Distributed under the terms of the MIT License.
6 #ifndef _PTHREAD_PRIVATE_H_
7 #define _PTHREAD_PRIVATE_H_
15 // _pthread_thread::flags values
16 #define THREAD_DETACHED 0x01
17 #define THREAD_DEAD 0x02
18 #define THREAD_CANCELED 0x04
19 #define THREAD_CANCEL_ENABLED 0x08
20 #define THREAD_CANCEL_ASYNCHRONOUS 0x10
23 struct thread_creation_attributes
;
25 // The public *_t types are only pointers to these structures
26 // This way, we are completely free to change them, which might be
27 // necessary in the future (not only due to the incomplete implementation
30 typedef struct _pthread_condattr
{
35 typedef struct _pthread_mutexattr
{
40 typedef struct _pthread_barrierattr
{
42 } pthread_barrierattr
;
44 typedef struct _pthread_attr
{
51 typedef struct _pthread_rwlockattr
{
55 typedef void (*pthread_key_destructor
)(void *data
);
59 pthread_key_destructor destructor
;
62 struct pthread_key_data
{
67 #define PTHREAD_UNUSED_SEQUENCE 0
69 typedef struct _pthread_thread
{
72 void *(*entry
)(void*);
75 struct pthread_key_data specific
[PTHREAD_KEYS_MAX
];
76 struct __pthread_cleanup_handler
*cleanup_handlers
;
84 void __pthread_key_call_destructors(pthread_thread
*thread
);
85 void __pthread_destroy_thread(void);
86 pthread_thread
*__allocate_pthread(void* (*entry
)(void*), void *data
);
87 void __init_pthread(pthread_thread
* thread
, void* (*entry
)(void*), void* data
);
88 status_t
__pthread_init_creation_attributes(
89 const pthread_attr_t
* pthreadAttributes
, pthread_t thread
,
90 status_t (*entryFunction
)(void*, void*), void* argument1
,
91 void* argument2
, const char* name
,
92 struct thread_creation_attributes
* attributes
);
98 #endif /* _PTHREAD_PRIVATE_H_ */