diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-27 08:02:03 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-30 16:16:23 +0200 |
commit | 5a598ac99b0de720a04afc5e2ac6764117589b90 (patch) | |
tree | 811d57df33c0f4fcc1cce61095cb5c0a33eadd7c /cpukit/posix/src/mutexdestroy.c | |
parent | posix: Delete POSIX_Mutex_Protocol::process_shared (diff) | |
download | rtems-5a598ac99b0de720a04afc5e2ac6764117589b90.tar.bz2 |
score: Add CORE mutex variants
Add CORE_recursive_mutex_Control and CORE_ceiling_mutex_Control to avoid
the run-time evaluation of attributes to figure out how a particular
mutex methods should behave. Start with the no protocol variants. This
eliminates the CORE_MUTEX_DISCIPLINES_FIFO and
CORE_MUTEX_DISCIPLINES_PRIORITY disciplines.
Diffstat (limited to 'cpukit/posix/src/mutexdestroy.c')
-rw-r--r-- | cpukit/posix/src/mutexdestroy.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/cpukit/posix/src/mutexdestroy.c b/cpukit/posix/src/mutexdestroy.c index 7fda7d3ac9..57e63937a9 100644 --- a/cpukit/posix/src/mutexdestroy.c +++ b/cpukit/posix/src/mutexdestroy.c @@ -37,21 +37,23 @@ int pthread_mutex_destroy( the_mutex = _POSIX_Mutex_Get( mutex, &queue_context ); if ( the_mutex != NULL ) { - _CORE_mutex_Acquire_critical( &the_mutex->Mutex, &queue_context ); + _POSIX_Mutex_Acquire_critical( the_mutex, &queue_context ); /* * XXX: There is an error for the mutex being locked * or being in use by a condition variable. */ - if ( !_CORE_mutex_Is_locked( &the_mutex->Mutex ) ) { + if ( + !_CORE_mutex_Is_locked( &the_mutex->Mutex.Recursive.Mutex ) + ) { _Objects_Close( &_POSIX_Mutex_Information, &the_mutex->Object ); - _CORE_mutex_Release( &the_mutex->Mutex, &queue_context ); - _CORE_mutex_Destroy( &the_mutex->Mutex ); + _POSIX_Mutex_Release( the_mutex, &queue_context ); + _CORE_mutex_Destroy( &the_mutex->Mutex.Recursive.Mutex ); _POSIX_Mutex_Free( the_mutex ); eno = 0; } else { - _CORE_mutex_Release( &the_mutex->Mutex, &queue_context ); + _POSIX_Mutex_Release( the_mutex, &queue_context ); eno = EBUSY; } } else { |