mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-26 16:44:49 +08:00
2011-02-14 Joel Sherrill <joel.sherrilL@OARcorp.com>
* score/include/rtems/score/coremutex.h, score/inline/rtems/score/coremutex.inl, score/src/apimutexallocate.c: Fix direction of conditional and eliminate use of nesting is error when POSIX is disabled.
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2011-02-14 Joel Sherrill <joel.sherrilL@OARcorp.com>
|
||||
|
||||
* score/include/rtems/score/coremutex.h,
|
||||
score/inline/rtems/score/coremutex.inl, score/src/apimutexallocate.c:
|
||||
Fix direction of conditional and eliminate use of nesting is error
|
||||
when POSIX is disabled.
|
||||
|
||||
2011-02-11 Joel Sherrill <joel.sherrilL@OARcorp.com>
|
||||
|
||||
* rtems/src/semtranslatereturncode.c,
|
||||
|
||||
@@ -85,7 +85,7 @@ typedef enum {
|
||||
* resource was unavailable.
|
||||
*/
|
||||
CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT,
|
||||
#if !defined(RTEMS_POSIX_API)
|
||||
#if defined(RTEMS_POSIX_API)
|
||||
/** This status indicates that an attempt was made to relock a mutex
|
||||
* for which nesting is not configured.
|
||||
*/
|
||||
@@ -142,6 +142,7 @@ typedef enum {
|
||||
* + unlock(m)
|
||||
*/
|
||||
CORE_MUTEX_NESTING_ACQUIRES,
|
||||
#if defined(RTEMS_POSIX_API)
|
||||
/**
|
||||
* This sequence returns an error at the indicated point:
|
||||
*
|
||||
@@ -150,6 +151,7 @@ typedef enum {
|
||||
* + unlock(m)
|
||||
*/
|
||||
CORE_MUTEX_NESTING_IS_ERROR,
|
||||
#endif
|
||||
/**
|
||||
* This sequence performs as indicated:
|
||||
* + lock(m)
|
||||
|
||||
@@ -205,10 +205,12 @@ RTEMS_INLINE_ROUTINE int _CORE_mutex_Seize_interrupt_trylock_body(
|
||||
the_mutex->nest_count++;
|
||||
_ISR_Enable( *level_p );
|
||||
return 0;
|
||||
case CORE_MUTEX_NESTING_IS_ERROR:
|
||||
executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED;
|
||||
_ISR_Enable( *level_p );
|
||||
return 0;
|
||||
#if defined(RTEMS_POSIX_API)
|
||||
case CORE_MUTEX_NESTING_IS_ERROR:
|
||||
executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED;
|
||||
_ISR_Enable( *level_p );
|
||||
return 0;
|
||||
#endif
|
||||
case CORE_MUTEX_NESTING_BLOCKS:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ void _API_Mutex_Allocate(
|
||||
API_Mutex_Control *mutex;
|
||||
|
||||
CORE_mutex_Attributes attr = {
|
||||
CORE_MUTEX_NESTING_IS_ERROR,
|
||||
CORE_MUTEX_NESTING_ACQUIRES,
|
||||
false,
|
||||
CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT,
|
||||
0
|
||||
|
||||
Reference in New Issue
Block a user