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:23:52 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-11-03 11:23:30 +0100
commit47d246436f5b95359325740f4deb2df6345c971e (patch)
tree0d006b98e2449d66b8b882c39ffb6ef107e1532f /cpukit/score/include/rtems/score/threadimpl.h
parentscore: Relax _Scheduler_Set() restrictions (diff)
downloadrtems-47d246436f5b95359325740f4deb2df6345c971e.tar.bz2
score: Conditionally enable thread resource count
Maintain the thread resource count only in debug configurations. This is a performance optimization for non-debug configurations.
Diffstat (limited to 'cpukit/score/include/rtems/score/threadimpl.h')
-rw-r--r--cpukit/score/include/rtems/score/threadimpl.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h
index 37127fbabd..61694461b4 100644
--- a/cpukit/score/include/rtems/score/threadimpl.h
+++ b/cpukit/score/include/rtems/score/threadimpl.h
@@ -977,16 +977,25 @@ RTEMS_INLINE_ROUTINE void _Thread_Resource_count_increment(
Thread_Control *the_thread
)
{
+#if defined(RTEMS_SCORE_THREAD_ENABLE_RESOURCE_COUNT)
++the_thread->resource_count;
+#else
+ (void) the_thread;
+#endif
}
RTEMS_INLINE_ROUTINE void _Thread_Resource_count_decrement(
Thread_Control *the_thread
)
{
+#if defined(RTEMS_SCORE_THREAD_ENABLE_RESOURCE_COUNT)
--the_thread->resource_count;
+#else
+ (void) the_thread;
+#endif
}
+#if defined(RTEMS_SCORE_THREAD_ENABLE_RESOURCE_COUNT)
/**
* @brief Returns true if the thread owns resources, and false otherwise.
*
@@ -1001,6 +1010,7 @@ RTEMS_INLINE_ROUTINE bool _Thread_Owns_resources(
{
return the_thread->resource_count != 0;
}
+#endif
#if defined(RTEMS_SMP)
RTEMS_INLINE_ROUTINE void _Thread_Scheduler_cancel_need_for_help(