summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/threadimpl.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-10-31 16:10:32 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-11-03 10:55:48 +0100
commit0dd49d001515897cceb9195eb97dfac683552a0b (patch)
tree4d43cf8b2fb32ae17ffc0d7d6109f02e44dcedca /cpukit/score/include/rtems/score/threadimpl.h
parentrtems: Fix binary semaphore resource count (diff)
downloadrtems-0dd49d001515897cceb9195eb97dfac683552a0b.tar.bz2
score: Introduce thread resource count methods
This makes it easier to conditionally enable/disable the thread resource count usage.
Diffstat (limited to 'cpukit/score/include/rtems/score/threadimpl.h')
-rw-r--r--cpukit/score/include/rtems/score/threadimpl.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h
index c7eef97254..37127fbabd 100644
--- a/cpukit/score/include/rtems/score/threadimpl.h
+++ b/cpukit/score/include/rtems/score/threadimpl.h
@@ -973,6 +973,20 @@ RTEMS_INLINE_ROUTINE bool _Thread_Is_joinable(
return ( the_thread->Life.state & THREAD_LIFE_DETACHED ) == 0;
}
+RTEMS_INLINE_ROUTINE void _Thread_Resource_count_increment(
+ Thread_Control *the_thread
+)
+{
+ ++the_thread->resource_count;
+}
+
+RTEMS_INLINE_ROUTINE void _Thread_Resource_count_decrement(
+ Thread_Control *the_thread
+)
+{
+ --the_thread->resource_count;
+}
+
/**
* @brief Returns true if the thread owns resources, and false otherwise.
*