summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/threadimpl.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-05-28 13:37:54 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-06-03 08:15:16 +0200
commit6c7caa1a9e1587dcc069aa811e9086c220b03ea8 (patch)
tree5470465893d892e0f0caffd3033e7b6efe68c508 /cpukit/score/include/rtems/score/threadimpl.h
parentscore: Add Resource Handler (diff)
downloadrtems-6c7caa1a9e1587dcc069aa811e9086c220b03ea8.tar.bz2
score: Add and use _Thread_Owns_resources()
Diffstat (limited to 'cpukit/score/include/rtems/score/threadimpl.h')
-rw-r--r--cpukit/score/include/rtems/score/threadimpl.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h
index 5e7660503a..8b91730d34 100644
--- a/cpukit/score/include/rtems/score/threadimpl.h
+++ b/cpukit/score/include/rtems/score/threadimpl.h
@@ -785,6 +785,23 @@ RTEMS_INLINE_ROUTINE bool _Thread_Is_life_changing(
return ( life_state & THREAD_LIFE_RESTARTING_TERMINATING ) != 0;
}
+/**
+ * @brief Returns true if the thread owns resources, and false otherwise.
+ *
+ * Resources are accounted with the Thread_Control::resource_count resource
+ * counter. This counter is used by semaphore objects for example.
+ *
+ * @param[in] the_thread The thread.
+ */
+RTEMS_INLINE_ROUTINE bool _Thread_Owns_resources(
+ const Thread_Control *the_thread
+)
+{
+ bool owns_resources = the_thread->resource_count != 0;
+
+ return owns_resources;
+}
+
RTEMS_INLINE_ROUTINE void _Thread_Debug_set_real_processor(
Thread_Control *the_thread,
Per_CPU_Control *cpu