diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-27 14:29:00 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-31 10:14:42 +0200 |
commit | b1ce11614b615065505cee398645e995e4cee39f (patch) | |
tree | 65e432f37ad0333a04a466ee05395dd78391f5c0 /cpukit/libmisc/monitor/mon-sema.c | |
parent | score: Delete CORE_mutex_Control::blocked_count (diff) | |
download | rtems-b1ce11614b615065505cee398645e995e4cee39f.tar.bz2 |
score: Delete CORE_mutex_Control::holder_id
We can use the holder pointer to get the identifier if necessary.
Diffstat (limited to 'cpukit/libmisc/monitor/mon-sema.c')
-rw-r--r-- | cpukit/libmisc/monitor/mon-sema.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/cpukit/libmisc/monitor/mon-sema.c b/cpukit/libmisc/monitor/mon-sema.c index c8a2b16280..df474eafc7 100644 --- a/cpukit/libmisc/monitor/mon-sema.c +++ b/cpukit/libmisc/monitor/mon-sema.c @@ -24,8 +24,7 @@ rtems_monitor_sema_canonical( canonical_sema->priority_ceiling = rtems_sema->Core_control.mutex.Attributes.priority_ceiling; - canonical_sema->holder_id = - rtems_sema->Core_control.mutex.holder_id; + canonical_sema->holder_id = 0; if (_Attributes_Is_counting_semaphore(canonical_sema->attribute)) { /* we have a counting semaphore */ @@ -36,6 +35,12 @@ rtems_monitor_sema_canonical( rtems_sema->Core_control.semaphore.Attributes.maximum_count; } else { + Thread_Control *holder = rtems_sema->Core_control.mutex.holder; + + if (holder != NULL) { + canonical_sema->holder_id = holder->Object.id; + } + /* 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 */ |