summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/debugisownerofallocator.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-05-02 14:27:24 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-05-19 12:00:47 +0200
commit4438ac2575fb9e0760bf53931a52d00dec4deb83 (patch)
tree1a81aa76215e781bdddd08a92f4be01454d330ae /cpukit/score/src/debugisownerofallocator.c
parentscore: Inline _CORE_semaphore_Surrender() (diff)
downloadrtems-4438ac2575fb9e0760bf53931a52d00dec4deb83.tar.bz2
score: Fine grained locking for mutexes
Update #2273.
Diffstat (limited to 'cpukit/score/src/debugisownerofallocator.c')
-rw-r--r--cpukit/score/src/debugisownerofallocator.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/cpukit/score/src/debugisownerofallocator.c b/cpukit/score/src/debugisownerofallocator.c
index 7879902025..57da2ca001 100644
--- a/cpukit/score/src/debugisownerofallocator.c
+++ b/cpukit/score/src/debugisownerofallocator.c
@@ -18,8 +18,7 @@
#include <rtems/score/assert.h>
#include <rtems/score/apimutex.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/threaddispatch.h>
+#include <rtems/score/threadimpl.h>
#if defined( RTEMS_DEBUG )
bool _Debug_Is_owner_of_allocator( void )
@@ -27,20 +26,12 @@
API_Mutex_Control *mutex = _RTEMS_Allocator_Mutex;
bool owner;
- /*
- * We have to synchronize with the _CORE_mutex_Surrender() operation,
- * otherwise we may observe an outdated mutex holder.
- */
- _Thread_Disable_dispatch();
-
if ( mutex != NULL ) {
- owner = mutex->Mutex.holder == _Thread_Executing;
+ owner = mutex->Mutex.holder == _Thread_Get_executing();
} else {
owner = false;
}
- _Thread_Enable_dispatch();
-
return owner;
}
#endif