ArDrone SDK 1.8 added
[mardrone] / mardrone / ARDrone_SDK_Version_1_8_20110726 / Examples / Multiplatform / Protocol / VP_Os / vp_os_signal.h
1 /**
2  * @file signal.h
3  * @author aurelien.morelle@parrot.fr
4  * @date 2006/12/15
5  */
6
7 #ifndef _SIGNAL_INCLUDE_OS_
8 #define _SIGNAL_INCLUDE_OS_
9
10
11 #include <VP_Os/vp_os_types.h>
12
13 #include <vp_os_signal_dep.h>
14
15 #ifdef __cplusplus
16 extern "C"
17 {
18 #endif
19
20
21 /**
22  * Initializes a mutex.
23  *
24  * @param mutex The mutex to initialize
25  */
26 void
27 vp_os_mutex_init(vp_os_mutex_t *mutex);
28
29 /**
30  * Destroys a mutex.
31  *
32  * @param mutex The mutex to destroy
33  */
34 void
35 vp_os_mutex_destroy(vp_os_mutex_t *mutex);
36
37 /**
38  * Locks a mutex.
39  *
40  * @param mutex The mutex to lock
41  */
42 void
43 vp_os_mutex_lock(vp_os_mutex_t *mutex);
44
45 /**
46  * Unlocks a mutex.
47  *
48  * @param mutex The mutex to unlock
49  */
50 void
51 vp_os_mutex_unlock(vp_os_mutex_t *mutex);
52
53
54 //#ifndef _NDS
55
56 /**
57  * Initializes a condition variable.
58  *
59  * @param cond  The condition to initialize
60  * @param mutex The mutex associated to this condition variable
61  */
62 void
63 vp_os_cond_init(vp_os_cond_t *cond, vp_os_mutex_t *mutex);
64
65 /**
66  * Destroys a condition variable.
67  *
68  * @param cond The condition to destroy
69  */
70 void
71 vp_os_cond_destroy(vp_os_cond_t *cond);
72
73 /**
74  * Waits for the signal of a condition variable.
75  *
76  * @param cond The condition to wait for
77  */
78 void
79 vp_os_cond_wait(vp_os_cond_t *cond);
80
81 /**
82  * Waits for the signal of a condition variable.
83  *
84  * @param cond The condition to wait for
85  * @param ms Time to wait in milliseconds
86  *
87  * @return  SUCCESS or FAIL (if delay has been reached before or not)
88  */
89 C_RESULT
90 vp_os_cond_timed_wait(vp_os_cond_t *cond, uint32_t ms);
91
92 /**
93  * Signals a condition variable.
94  *
95  * @param cond The condition to signal
96  */
97 void
98 vp_os_cond_signal(vp_os_cond_t *cond);
99
100 #ifdef __cplusplus
101 }
102 #endif
103 //#endif // ! _NDS
104
105
106 #endif // ! _SIGNAL_INCLUDE_OS_
107