summaryrefslogtreecommitdiffstats
path: root/cpukit/score
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1996-02-01 22:09:07 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1996-02-01 22:09:07 +0000
commit4f60309bdd5bf0785586e30d0c9e419f699d051f (patch)
tree69b9f173157a538f7292355c27e5bfee789bfd84 /cpukit/score
parentsynchronization state bugs address (diff)
downloadrtems-4f60309bdd5bf0785586e30d0c9e419f699d051f.tar.bz2
Swapped order of nested acquisition check and check for returning unsatisfied.
Diffstat (limited to 'cpukit/score')
-rw-r--r--cpukit/score/src/coremutex.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/cpukit/score/src/coremutex.c b/cpukit/score/src/coremutex.c
index 08d1630b7f..a0c3fd0264 100644
--- a/cpukit/score/src/coremutex.c
+++ b/cpukit/score/src/coremutex.c
@@ -122,12 +122,6 @@ void _CORE_mutex_Seize(
return;
}
- if ( !wait ) {
- _ISR_Enable( level );
- executing->Wait.return_code = CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT;
- return;
- }
-
if ( _Objects_Are_ids_equal(
_Thread_Executing->Object.id, the_mutex->holder_id ) ) {
if ( _CORE_mutex_Is_nesting_allowed( &the_mutex->Attributes ) )
@@ -139,6 +133,12 @@ void _CORE_mutex_Seize(
return;
}
+ if ( !wait ) {
+ _ISR_Enable( level );
+ executing->Wait.return_code = CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT;
+ return;
+ }
+
_Thread_queue_Enter_critical_section( &the_mutex->Wait_queue );
executing->Wait.queue = &the_mutex->Wait_queue;
executing->Wait.id = id;