diff options
Diffstat (limited to 'cpukit/score/src/corerwlockobtainwrite.c')
-rw-r--r-- | cpukit/score/src/corerwlockobtainwrite.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/cpukit/score/src/corerwlockobtainwrite.c b/cpukit/score/src/corerwlockobtainwrite.c index a7d1bb1b6a..0536b8287f 100644 --- a/cpukit/score/src/corerwlockobtainwrite.c +++ b/cpukit/score/src/corerwlockobtainwrite.c @@ -19,11 +19,12 @@ #endif #include <rtems/score/corerwlockimpl.h> +#include <rtems/score/threadimpl.h> #include <rtems/score/threadqimpl.h> #include <rtems/score/statesimpl.h> #include <rtems/score/watchdog.h> -void _CORE_RWLock_Seize_for_writing( +Status_Control _CORE_RWLock_Seize_for_writing( CORE_RWLock_Control *the_rwlock, Thread_Control *executing, bool wait, @@ -44,8 +45,7 @@ void _CORE_RWLock_Seize_for_writing( case CORE_RWLOCK_UNLOCKED: the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; _CORE_RWLock_Release( the_rwlock, queue_context ); - executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; - return; + return STATUS_SUCCESSFUL; case CORE_RWLOCK_LOCKED_FOR_READING: case CORE_RWLOCK_LOCKED_FOR_WRITING: @@ -58,16 +58,14 @@ void _CORE_RWLock_Seize_for_writing( if ( !wait ) { _CORE_RWLock_Release( the_rwlock, queue_context ); - executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; - return; + return STATUS_UNAVAILABLE; } /* * We need to wait to enter this critical section */ - executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_WRITE; - executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; + executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_WRITE; _Thread_queue_Enqueue_critical( &the_rwlock->Wait_queue.Queue, @@ -75,7 +73,7 @@ void _CORE_RWLock_Seize_for_writing( executing, STATES_WAITING_FOR_RWLOCK, timeout, - CORE_RWLOCK_TIMEOUT, &queue_context->Lock_context ); + return _Thread_Wait_get_status( executing ); } |