ArDrone SDK 1.8 added
[mardrone] / mardrone / ARDrone_SDK_Version_1_8_20110726 / Examples / Multiplatform / Protocol / VP_Os / vp_os_thread.h
1 /**
2  * @file thread.h
3  * @author aurelien.morelle@parrot.fr
4  * @date 2006/12/15
5  */
6
7 #ifndef _THREAD_INCLUDE_OS_
8 #define _THREAD_INCLUDE_OS_
9
10 #include <VP_Os/vp_os_types.h>
11 #include <vp_os_thread_dep.h>
12
13
14 /**
15  * Prototype definition of a thread routine.
16  */
17 #define DEFINE_THREAD_ROUTINE(NomRoutine,NomParams) THREAD_RET WINAPI thread_##NomRoutine(THREAD_PARAMS NomParams)
18
19
20 /**
21  * Creates and starts a thread.
22  *
23  * @param f          The thread routine
24  * @param parameters The parameters passed to the thread routine
25  * @param handle     The returned handle of the created thread
26  *
27  * Variadic parameters : only for eCos
28  * @param sched_info Sechduling priority
29  * @param name       Thread name
30  * @param stack_base Stack address
31  * @param stack_size Stack size
32  * @param thread     cyg_thread_t object
33  */
34 void
35 vp_os_thread_create(THREAD_ROUTINE f, THREAD_PARAMS parameters, THREAD_HANDLE *handle, ...);
36
37 /**
38  * Waits for a thread to terminate.
39  *
40  * @param handle The handle of the thread to wait for the termination
41  */
42 void
43 vp_os_thread_join(THREAD_HANDLE handle);
44
45 THREAD_HANDLE
46 vp_os_thread_self(void);
47
48 void
49 vp_os_thread_suspend(THREAD_HANDLE handle);
50
51 void
52 vp_os_thread_resume(THREAD_HANDLE handle);
53
54 void
55 vp_os_thread_yield(void);
56
57 void
58 vp_os_thread_priority(THREAD_HANDLE handle, int32_t priority);
59
60 #endif // ! _THREAD_INCLUDE_OS_
61