diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-07-19 13:17:42 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-07-19 13:17:42 +0000 |
commit | d58064a533743df77e52f9d76385a9e0ea1d0227 (patch) | |
tree | 2e76847d1640e8c9f27a0c2fc0bf8ce60ba4b0b4 /os/kernel/include/chcond.h | |
parent | 84e044f176cee7c6946b24c36c90f63534b5b369 (diff) | |
download | ChibiOS-d58064a533743df77e52f9d76385a9e0ea1d0227.tar.gz ChibiOS-d58064a533743df77e52f9d76385a9e0ea1d0227.tar.bz2 ChibiOS-d58064a533743df77e52f9d76385a9e0ea1d0227.zip |
Still work in progress.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@5996 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/kernel/include/chcond.h')
-rw-r--r-- | os/kernel/include/chcond.h | 76 |
1 files changed, 51 insertions, 25 deletions
diff --git a/os/kernel/include/chcond.h b/os/kernel/include/chcond.h index 202f4125c..d692310b6 100644 --- a/os/kernel/include/chcond.h +++ b/os/kernel/include/chcond.h @@ -34,37 +34,37 @@ #if CH_USE_CONDVARS || defined(__DOXYGEN__)
-/*
- * Module dependencies check.
- */
+/*===========================================================================*/
+/* Module constants. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Module pre-compile time settings. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Derived constants and error checks. */
+/*===========================================================================*/
+
#if !CH_USE_MUTEXES
#error "CH_USE_CONDVARS requires CH_USE_MUTEXES"
#endif
+/*===========================================================================*/
+/* Module data structures and types. */
+/*===========================================================================*/
+
/**
- * @brief CondVar structure.
+ * @brief condition_variable_t structure.
*/
-typedef struct CondVar {
- threads_queue_t c_queue; /**< @brief CondVar threads queue.*/
-} CondVar;
+typedef struct condition_variable {
+ threads_queue_t c_queue; /**< @brief Condition variable
+ threads queue. */
+} condition_variable_t;
-#ifdef __cplusplus
-extern "C" {
-#endif
- void chCondInit(CondVar *cp);
- void chCondSignal(CondVar *cp);
- void chCondSignalI(CondVar *cp);
- void chCondBroadcast(CondVar *cp);
- void chCondBroadcastI(CondVar *cp);
- msg_t chCondWait(CondVar *cp);
- msg_t chCondWaitS(CondVar *cp);
-#if CH_USE_CONDVARS_TIMEOUT
- msg_t chCondWaitTimeout(CondVar *cp, systime_t time);
- msg_t chCondWaitTimeoutS(CondVar *cp, systime_t time);
-#endif
-#ifdef __cplusplus
-}
-#endif
+/*===========================================================================*/
+/* Module macros. */
+/*===========================================================================*/
/**
* @brief Data part of a static condition variable initializer.
@@ -82,7 +82,33 @@ extern "C" { *
* @param[in] name the name of the condition variable
*/
-#define CONDVAR_DECL(name) CondVar name = _CONDVAR_DATA(name)
+#define CONDVAR_DECL(name) condition_variable_t name = _CONDVAR_DATA(name)
+
+/*===========================================================================*/
+/* External declarations. */
+/*===========================================================================*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ void chCondInit(condition_variable_t *cp);
+ void chCondSignal(condition_variable_t *cp);
+ void chCondSignalI(condition_variable_t *cp);
+ void chCondBroadcast(condition_variable_t *cp);
+ void chCondBroadcastI(condition_variable_t *cp);
+ msg_t chCondWait(condition_variable_t *cp);
+ msg_t chCondWaitS(condition_variable_t *cp);
+#if CH_USE_CONDVARS_TIMEOUT
+ msg_t chCondWaitTimeout(condition_variable_t *cp, systime_t time);
+ msg_t chCondWaitTimeoutS(condition_variable_t *cp, systime_t time);
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+/*===========================================================================*/
+/* Module inline functions. */
+/*===========================================================================*/
#endif /* CH_USE_CONDVARS */
|