[rtems commit] score: Add _Thread_queue_Is_empty()

Sebastian Huber sebh at rtems.org
Fri Apr 22 07:28:44 UTC 2016


Module:    rtems
Branch:    master
Commit:    b46622684ac3194d75bab2a6d9a3d55f4897ae24
Changeset: http://git.rtems.org/rtems/commit/?id=b46622684ac3194d75bab2a6d9a3d55f4897ae24

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Apr 20 06:57:47 2016 +0200

score: Add _Thread_queue_Is_empty()

---

 cpukit/score/include/rtems/score/threadqimpl.h | 7 +++++++
 testsuites/sptests/spthreadq01/init.c          | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/cpukit/score/include/rtems/score/threadqimpl.h b/cpukit/score/include/rtems/score/threadqimpl.h
index 7b1c896..68ce109 100644
--- a/cpukit/score/include/rtems/score/threadqimpl.h
+++ b/cpukit/score/include/rtems/score/threadqimpl.h
@@ -547,6 +547,13 @@ void _Thread_queue_Extract_with_proxy(
   Thread_Control       *the_thread
 );
 
+RTEMS_INLINE_ROUTINE bool _Thread_queue_Is_empty(
+  const Thread_queue_Queue *queue
+)
+{
+  return queue->heads == NULL;
+}
+
 /**
  * @brief Returns the first thread on the thread queue if it exists, otherwise
  * @c NULL.
diff --git a/testsuites/sptests/spthreadq01/init.c b/testsuites/sptests/spthreadq01/init.c
index c1812f6..fb2be64 100644
--- a/testsuites/sptests/spthreadq01/init.c
+++ b/testsuites/sptests/spthreadq01/init.c
@@ -375,7 +375,7 @@ static rtems_task Init(
   test_classic_obj(ctx);
   test_posix_obj(ctx);
 
-  rtems_test_assert( queue.Queue.heads == NULL );
+  rtems_test_assert( _Thread_queue_Is_empty( &queue.Queue ) );
 
   TEST_END();
   rtems_test_exit(0);




More information about the vc mailing list