From 5870ac55678115857215a4199f519263599ee341 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 5 Jan 2000 22:19:21 +0000 Subject: Added support for simple binary semaphores in addition to the high power binary/mutex style semaphores already supported by RTEMS. This was done at the request of Eric Norum in support of his effort to port EPICS to RTEMS. This change consisted of changing the nesting_allowed boolean into a lock_nesting_behavior enumerated value as well as allowing the core mutex object to optionally support ensuring that the holder of a binary semaphore released it. Finally, a more subtle enhancement was to allow the non-holder to release a priority inheritance/ceiling mutex and still allow the holding task to return to its original priority. --- cpukit/posix/src/mutexinit.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cpukit/posix/src/mutexinit.c') diff --git a/cpukit/posix/src/mutexinit.c b/cpukit/posix/src/mutexinit.c index 04c8c8132f..f72edf694a 100644 --- a/cpukit/posix/src/mutexinit.c +++ b/cpukit/posix/src/mutexinit.c @@ -144,7 +144,11 @@ int pthread_mutex_init( the_mutex_attr = &the_mutex->Mutex.Attributes; - the_mutex_attr->allow_nesting = the_attr->recursive; + if ( the_attr->recursive ) + the_mutex_attr->lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; + else + the_mutex_attr->lock_nesting_behavior = CORE_MUTEX_NESTING_IS_ERROR; + the_mutex_attr->only_owner_release = TRUE; the_mutex_attr->priority_ceiling = _POSIX_Priority_To_core( the_attr->prio_ceiling ); the_mutex_attr->discipline = the_discipline; -- cgit v1.2.3