From fb1d8f81a0e38540fb470da89d044dd28b0134ad Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 30 Aug 2001 18:33:57 +0000 Subject: 2001-08-30 Joel Sherrill * src/coremutex.c, src/coremutexseize.c, src/coremutexsurrender.c, inline/rtems/score/coremutex.inl: The per thread field resource_count should only be manipulated when a mutex is priority ceiling or priority inherit. This was reported by Chris Johns who also noticed that the use of switches for all disciplines generated less efficient code than using explicit tests for the one or two cases we were really interested in. Further review of his modifications made it apparent that the "isa" methods to test mutex discipline were not being used so this modification was swept into the code as well. --- cpukit/score/src/coremutex.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cpukit/score/src/coremutex.c') diff --git a/cpukit/score/src/coremutex.c b/cpukit/score/src/coremutex.c index ef2c21adc6..8edb80fcfb 100644 --- a/cpukit/score/src/coremutex.c +++ b/cpukit/score/src/coremutex.c @@ -73,7 +73,9 @@ void _CORE_mutex_Initialize( the_mutex->nest_count = 1; the_mutex->holder = _Thread_Executing; the_mutex->holder_id = _Thread_Executing->Object.id; - _Thread_Executing->resource_count++; + if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || + _CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) + _Thread_Executing->resource_count++; } else { the_mutex->nest_count = 0; the_mutex->holder = NULL; -- cgit v1.2.3