diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2017-04-11 11:08:36 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2017-04-11 11:08:36 +0000 |
commit | 477baaed5a9158b120ba9a485b285ba218d0d5cd (patch) | |
tree | 78510dbe556d7479419e019a98f2914430482cd6 /os/nil/include | |
parent | ca129dc5b437343cb35b38206363a9b5940971af (diff) | |
download | ChibiOS-477baaed5a9158b120ba9a485b285ba218d0d5cd.tar.gz ChibiOS-477baaed5a9158b120ba9a485b285ba218d0d5cd.tar.bz2 ChibiOS-477baaed5a9158b120ba9a485b285ba218d0d5cd.zip |
Threads queues completed in NIL.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10155 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/nil/include')
-rw-r--r-- | os/nil/include/ch.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/os/nil/include/ch.h b/os/nil/include/ch.h index f21527c2d..8fc480776 100644 --- a/os/nil/include/ch.h +++ b/os/nil/include/ch.h @@ -534,6 +534,9 @@ struct nil_thread { void *p; /**< @brief Generic pointer. */
thread_reference_t *trp; /**< @brief Pointer to thread reference.*/
threads_queue_t *tqp; /**< @brief Pointer to thread queue. */
+#if (CH_CFG_USE_SEMAPHORES == TRUE) || defined(__DOXYGEN__)
+ semaphore_t *semp; /**< @brief Pointer to semaphore. */
+#endif
#if (CH_CFG_USE_EVENTS == TRUE) || defined(__DOXYGEN__)
eventmask_t ewmask; /**< @brief Enabled events mask. */
#endif
@@ -912,6 +915,29 @@ struct nil_system { /** @} */
/**
+ * @name Threads queues
+ */
+/**
+ * @brief Data part of a static threads queue object initializer.
+ * @details This macro should be used when statically initializing a threads
+ * queue that is part of a bigger structure.
+ *
+ * @param[in] name the name of the threads queue variable
+ */
+#define _THREADS_QUEUE_DATA(name) {(cnt_t)0}
+
+/**
+ * @brief Static threads queue object initializer.
+ * @details Statically initialized threads queues require no explicit
+ * initialization using @p queue_init().
+ *
+ * @param[in] name the name of the threads queue variable
+ */
+#define _THREADS_QUEUE_DECL(name) \
+ threads_queue_t name = _THREADS_QUEUE_DATA(name)
+/** @} */
+
+/**
* @name Semaphores macros
* @{
*/
@@ -1367,6 +1393,7 @@ extern "C" { void chThdResumeI(thread_reference_t *trp, msg_t msg);
void chThdSleep(systime_t timeout);
void chThdSleepUntil(systime_t abstime);
+ msg_t chThdEnqueueTimeoutS(threads_queue_t *tqp, systime_t timeout);
void chThdDoDequeueNextI(threads_queue_t *tqp, msg_t msg);
void chThdDequeueNextI(threads_queue_t *tqp, msg_t msg);
void chThdDequeueAllI(threads_queue_t *tqp, msg_t msg);
|