diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2000-01-05 22:19:21 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2000-01-05 22:19:21 +0000 |
commit | 5870ac55678115857215a4199f519263599ee341 (patch) | |
tree | 8b6f044ae7cccc3da9a3bd69b2468c2ca77acff8 /cpukit/posix/src | |
parent | Updated to reflect a time that had previously been left out due to (diff) | |
download | rtems-5870ac55678115857215a4199f519263599ee341.tar.bz2 |
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 <eric@cls.usask.ca> 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.
Diffstat (limited to '')
-rw-r--r-- | cpukit/posix/src/mutexinit.c | 6 |
1 files changed, 5 insertions, 1 deletions
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; |