summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/coremutex.h
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2000-01-05 22:19:21 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2000-01-05 22:19:21 +0000
commit5870ac55678115857215a4199f519263599ee341 (patch)
tree8b6f044ae7cccc3da9a3bd69b2468c2ca77acff8 /cpukit/score/include/rtems/score/coremutex.h
parentUpdated to reflect a time that had previously been left out due to (diff)
downloadrtems-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 'cpukit/score/include/rtems/score/coremutex.h')
-rw-r--r--cpukit/score/include/rtems/score/coremutex.h36
1 files changed, 33 insertions, 3 deletions
diff --git a/cpukit/score/include/rtems/score/coremutex.h b/cpukit/score/include/rtems/score/coremutex.h
index 73f92c76e0..32e4f40b5e 100644
--- a/cpukit/score/include/rtems/score/coremutex.h
+++ b/cpukit/score/include/rtems/score/coremutex.h
@@ -63,6 +63,35 @@ typedef enum {
} CORE_mutex_Status;
/*
+ * Mutex lock nesting behavior
+ *
+ * CORE_MUTEX_NESTING_ACQUIRES:
+ * This sequence has no blocking or errors:
+ * lock(m)
+ * lock(m)
+ * unlock(m)
+ * unlock(m)
+ *
+ * CORE_MUTEX_NESTING_IS_ERROR
+ * This sequence returns an error at the indicated point:
+ * lock(m)
+ * lock(m) - already locked error
+ * unlock(m)
+ *
+ * CORE_MUTEX_NESTING_BLOCKS
+ * This sequence performs as indicated:
+ * lock(m)
+ * lock(m) - deadlocks or timeouts
+ * unlock(m) - releases
+ */
+
+typedef enum {
+ CORE_MUTEX_NESTING_ACQUIRES,
+ CORE_MUTEX_NESTING_IS_ERROR,
+ CORE_MUTEX_NESTING_BLOCKS
+} CORE_mutex_Nesting_behaviors;
+
+/*
* Locked and unlocked values
*/
@@ -75,9 +104,10 @@ typedef enum {
*/
typedef struct {
- boolean allow_nesting;
- CORE_mutex_Disciplines discipline;
- Priority_Control priority_ceiling;
+ CORE_mutex_Nesting_behaviors lock_nesting_behavior;
+ boolean only_owner_release;
+ CORE_mutex_Disciplines discipline;
+ Priority_Control priority_ceiling;
} CORE_mutex_Attributes;
/*