summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/objectactivecount.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-27 14:16:12 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-31 08:29:44 +0200
commit23fec9f0e18dc4913fab818118f836af150b98f3 (patch)
tree66228f23bbf654117a33e28db7a017eea21fb785 /cpukit/score/src/objectactivecount.c
parentscore: Use thread life protection for API mutexes (diff)
downloadrtems-23fec9f0e18dc4913fab818118f836af150b98f3.tar.bz2
score: PR2152: Use allocator mutex for objects
Use allocator mutex for objects allocate/free. This prevents that the thread dispatch latency depends on the workspace/heap fragmentation.
Diffstat (limited to 'cpukit/score/src/objectactivecount.c')
-rw-r--r--cpukit/score/src/objectactivecount.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/cpukit/score/src/objectactivecount.c b/cpukit/score/src/objectactivecount.c
index de34212f29..de3243afcb 100644
--- a/cpukit/score/src/objectactivecount.c
+++ b/cpukit/score/src/objectactivecount.c
@@ -17,14 +17,20 @@
#endif
#include <rtems/score/objectimpl.h>
+#include <rtems/score/assert.h>
#include <rtems/score/chainimpl.h>
Objects_Maximum _Objects_Active_count(
const Objects_Information *information
)
{
- size_t inactive = _Chain_Node_count_unprotected( &information->Inactive );
- size_t maximum = information->maximum;
+ size_t inactive;
+ size_t maximum;
+
+ _Assert( _Debug_Is_owner_of_allocator() );
+
+ inactive = _Chain_Node_count_unprotected( &information->Inactive );
+ maximum = information->maximum;
return (Objects_Maximum) ( maximum - inactive );
}