diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-12-21 15:50:09 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-12-21 15:50:09 +0000 |
commit | fd84982c0019205ea5e4c226f47dd62480cfd5e6 (patch) | |
tree | b2915444f038f690cd390dfee72cc896319ba7b4 /cpukit/score/inline/rtems/score/coremutex.inl | |
parent | 2007-12-21 Joel Sherrill <joel.sherrill@OARcorp.com> (diff) | |
download | rtems-fd84982c0019205ea5e4c226f47dd62480cfd5e6.tar.bz2 |
2007-12-21 Xi Yang <hiyangxi@gmail.com>
* configure.ac, score/include/rtems/score/coremutex.h,
score/include/rtems/score/thread.h,
score/inline/rtems/score/coremutex.inl,
score/src/coremutexsurrender.c, score/src/threadinitialize.c: Add
support for proper stacking of priority inheritance on mutexes as
well as enforce proper order of release.
Diffstat (limited to '')
-rw-r--r-- | cpukit/score/inline/rtems/score/coremutex.inl | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/cpukit/score/inline/rtems/score/coremutex.inl b/cpukit/score/inline/rtems/score/coremutex.inl index 342428ccbb..9311cd11a5 100644 --- a/cpukit/score/inline/rtems/score/coremutex.inl +++ b/cpukit/score/inline/rtems/score/coremutex.inl @@ -101,7 +101,6 @@ RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_inherit_priority( * PRIORITY_CEILING and FALSE otherwise. * * @param[in] the_attribute is the attribute set of the mutex - * * @return This method returns TRUE if the mutex is using priority * ceiling. */ @@ -120,7 +119,8 @@ RTEMS_INLINE_ROUTINE boolean _CORE_mutex_Is_priority_ceiling( * * NOTE: The Doxygen for this routine is in the .h file. */ -RTEMS_INLINE_ROUTINE int _CORE_mutex_Seize_interrupt_trylock( + +RTEMS_INLINE_ROUTINE int _CORE_mutex_Seize_interrupt_trylock_body( CORE_mutex_Control *the_mutex, ISR_Level *level_p ) @@ -138,8 +138,16 @@ RTEMS_INLINE_ROUTINE int _CORE_mutex_Seize_interrupt_trylock( the_mutex->holder_id = executing->Object.id; the_mutex->nest_count = 1; if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || - _CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) + _CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ){ + +#ifdef __STRICT_ORDER_MUTEX__ + _Chain_Prepend_unprotected(&executing->lock_mutex,&the_mutex->queue.lock_queue); + the_mutex->queue.priority_before = executing->current_priority; +#endif + executing->resource_count++; + } + if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { _ISR_Enable( level ); return 0; |