aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-09-10 12:35:59 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-09-10 12:35:59 +0000
commit3b9ae6825f753e21f2db109d7b1005a6acfe475c (patch)
tree96de78ad0895d074d075c97a145c4dbbdb4c02b1 /os
parent530c3a6f9e58a9b7dd2439424bde767d136cbef3 (diff)
downloadChibiOS-3b9ae6825f753e21f2db109d7b1005a6acfe475c.tar.gz
ChibiOS-3b9ae6825f753e21f2db109d7b1005a6acfe475c.tar.bz2
ChibiOS-3b9ae6825f753e21f2db109d7b1005a6acfe475c.zip
Added function chThdQueueIsEmptyI(), fixed a naming error in threads queues static initializer.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7255 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r--os/rt/include/chcond.h2
-rw-r--r--os/rt/include/chmtx.h4
-rw-r--r--os/rt/include/chqueues.h4
-rw-r--r--os/rt/include/chsem.h2
-rw-r--r--os/rt/include/chthreads.h17
5 files changed, 23 insertions, 6 deletions
diff --git a/os/rt/include/chcond.h b/os/rt/include/chcond.h
index 94be40c74..80c3651c7 100644
--- a/os/rt/include/chcond.h
+++ b/os/rt/include/chcond.h
@@ -73,7 +73,7 @@ typedef struct condition_variable {
*
* @param[in] name the name of the condition variable
*/
-#define _CONDVAR_DATA(name) {_threads_queue_t_DATA(name.c_queue)}
+#define _CONDVAR_DATA(name) {_THREADS_QUEUE_DATA(name.c_queue)}
/**
* @brief Static condition variable initializer.
diff --git a/os/rt/include/chmtx.h b/os/rt/include/chmtx.h
index 097b349c5..ecfffae92 100644
--- a/os/rt/include/chmtx.h
+++ b/os/rt/include/chmtx.h
@@ -79,9 +79,9 @@ struct mutex {
* @param[in] name the name of the mutex variable
*/
#if CH_CFG_USE_MUTEXES_RECURSIVE || defined(__DOXYGEN__)
-#define _MUTEX_DATA(name) {_threads_queue_t_DATA(name.m_queue), NULL, NULL, 0}
+#define _MUTEX_DATA(name) {_THREADS_QUEUE_DATA(name.m_queue), NULL, NULL, 0}
#else
-#define _MUTEX_DATA(name) {_threads_queue_t_DATA(name.m_queue), NULL, NULL}
+#define _MUTEX_DATA(name) {_THREADS_QUEUE_DATA(name.m_queue), NULL, NULL}
#endif
/**
diff --git a/os/rt/include/chqueues.h b/os/rt/include/chqueues.h
index 63d91c090..c86a68fea 100644
--- a/os/rt/include/chqueues.h
+++ b/os/rt/include/chqueues.h
@@ -129,7 +129,7 @@ typedef io_queue_t output_queue_t;
* @param[in] link application defined pointer
*/
#define _INPUTQUEUE_DATA(name, buffer, size, inotify, link) { \
- _threads_queue_t_DATA(name), \
+ _THREADS_QUEUE_DATA(name), \
0, \
(uint8_t *)(buffer), \
(uint8_t *)(buffer) + (size), \
@@ -165,7 +165,7 @@ typedef io_queue_t output_queue_t;
* @param[in] link application defined pointer
*/
#define _OUTPUTQUEUE_DATA(name, buffer, size, onotify, link) { \
- _threads_queue_t_DATA(name), \
+ _THREADS_QUEUE_DATA(name), \
(size), \
(uint8_t *)(buffer), \
(uint8_t *)(buffer) + (size), \
diff --git a/os/rt/include/chsem.h b/os/rt/include/chsem.h
index badebc3f9..4762da9df 100644
--- a/os/rt/include/chsem.h
+++ b/os/rt/include/chsem.h
@@ -69,7 +69,7 @@ typedef struct semaphore {
* @param[in] n the counter initial value, this value must be
* non-negative
*/
-#define _SEMAPHORE_DATA(name, n) {_threads_queue_t_DATA(name.s_queue), n}
+#define _SEMAPHORE_DATA(name, n) {_THREADS_QUEUE_DATA(name.s_queue), n}
/**
* @brief Static semaphore initializer.
diff --git a/os/rt/include/chthreads.h b/os/rt/include/chthreads.h
index 03ac3fba7..ca2d3bcbc 100644
--- a/os/rt/include/chthreads.h
+++ b/os/rt/include/chthreads.h
@@ -376,6 +376,23 @@ static inline void chThdQueueObjectInit(threads_queue_t *tqp) {
queue_init(tqp);
}
+/**
+ * @brief Evaluates to @p true if the specified queue is empty.
+ *
+ * @param[out] tqp pointer to the threads queue object
+ * @return The queue status.
+ * @retval false if the queue is not empty.
+ * @retval true if the queue is empty.
+ *
+ * @iclass
+ */
+static inline bool chThdQueueIsEmptyI(threads_queue_t *tqp) {
+
+ chDbgCheckClassI();
+
+ return queue_isempty(tqp);
+}
+
#endif /* _CHTHREADS_H_ */
/** @} */