summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/pheapwalk.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-09-07 19:39:25 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-09-07 19:39:25 +0000
commit5ae327bcf7998573c437fafbc0c298c252c7eec1 (patch)
tree553bbfadcf4d4ac41e893ff29c2716a45f3cc591 /cpukit/score/src/pheapwalk.c
parent2007-09-07 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-5ae327bcf7998573c437fafbc0c298c252c7eec1.tar.bz2
2007-09-07 Joel Sherrill <joel.sherrill@oarcorp.com>
* score/src/heap.c: Style. * score/src/heapwalk.c: Add more information to prints. * score/src/pheapwalk.c: Do not lock allocator mutex if dispatching is disabled.
Diffstat (limited to 'cpukit/score/src/pheapwalk.c')
-rw-r--r--cpukit/score/src/pheapwalk.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/cpukit/score/src/pheapwalk.c b/cpukit/score/src/pheapwalk.c
index 963be088c3..e20cf124d7 100644
--- a/cpukit/score/src/pheapwalk.c
+++ b/cpukit/score/src/pheapwalk.c
@@ -24,8 +24,19 @@ boolean _Protected_heap_Walk(
{
boolean status;
- _RTEMS_Lock_allocator();
+ /*
+ * If we are called from within a dispatching critical section,
+ * then it is forbidden to lock a mutex. But since we are inside
+ * a critical section, it should be safe to walk it unlocked.
+ *
+ * NOTE: Dispatching is also disabled during initialization.
+ */
+ if ( !_Thread_Dispatch_disable_level ) {
+ _RTEMS_Lock_allocator();
+ status = _Heap_Walk( the_heap, source, do_dump );
+ _RTEMS_Unlock_allocator();
+ } else {
status = _Heap_Walk( the_heap, source, do_dump );
- _RTEMS_Unlock_allocator();
+ }
return status;
}