summaryrefslogtreecommitdiffstats
path: root/cpukit/libmisc/monitor/mon-sema.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/libmisc/monitor/mon-sema.c')
-rw-r--r--cpukit/libmisc/monitor/mon-sema.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/cpukit/libmisc/monitor/mon-sema.c b/cpukit/libmisc/monitor/mon-sema.c
index df474eafc7..10448663d9 100644
--- a/cpukit/libmisc/monitor/mon-sema.c
+++ b/cpukit/libmisc/monitor/mon-sema.c
@@ -35,15 +35,17 @@ rtems_monitor_sema_canonical(
rtems_sema->Core_control.semaphore.Attributes.maximum_count;
}
else {
+ /* we have a binary semaphore (mutex) */
Thread_Control *holder = rtems_sema->Core_control.mutex.holder;
if (holder != NULL) {
canonical_sema->holder_id = holder->Object.id;
+ canonical_sema->cur_count = 0;
+ } else {
+ canonical_sema->cur_count = 1;
}
- /* we have a binary semaphore (mutex) */
- canonical_sema->cur_count = rtems_sema->Core_control.mutex.lock;
- canonical_sema->max_count = 1; /* mutex is either 0 or 1 */
+ canonical_sema->max_count = 1; /* mutex is either 0 or 1 */
}
}