2 * Copyright 2008-2011, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
5 #ifndef _SYSTEM_THREAD_DEFS_H
6 #define _SYSTEM_THREAD_DEFS_H
14 /** Size of the stack given to teams in user space */
15 #define USER_STACK_GUARD_SIZE (4 * B_PAGE_SIZE) // 16 kB
16 #define MIN_USER_STACK_SIZE (2 * B_PAGE_SIZE) // 8 kB
17 #define MAX_USER_STACK_SIZE (4096 * B_PAGE_SIZE) // 16 MB
18 #define USER_MAIN_THREAD_STACK_SIZE MAX_USER_STACK_SIZE
19 #define USER_STACK_SIZE (64 * B_PAGE_SIZE) // 256 kB
22 // The type of object a thread blocks on (thread::wait::type, set by
23 // thread_prepare_to_block()).
25 THREAD_BLOCK_TYPE_SEMAPHORE
= 0,
26 THREAD_BLOCK_TYPE_CONDITION_VARIABLE
= 1,
27 THREAD_BLOCK_TYPE_SNOOZE
= 2,
28 THREAD_BLOCK_TYPE_SIGNAL
= 3,
29 THREAD_BLOCK_TYPE_MUTEX
= 4,
30 THREAD_BLOCK_TYPE_RW_LOCK
= 5,
32 THREAD_BLOCK_TYPE_OTHER
= 9999,
33 THREAD_BLOCK_TYPE_USER_BASE
= 10000
37 #define THREAD_CREATION_FLAG_DEFER_SIGNALS 0x01
38 // create the thread with signals deferred, i.e. with
39 // user_thread::defer_signals set to 1
42 struct thread_creation_attributes
{
43 int32 (*entry
)(void*, void*);
55 #endif /* _SYSTEM_THREAD_DEFS_H */