summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-01-31 09:01:37 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-01-31 09:38:08 +0100
commitf7ba2945d3ce6c27e67ce61091963995a93d3401 (patch)
tree0e2df4b49f693fd9d3725b457235bff17674015d
parente366f774a76d3607ad41dc0992e787ce38df980d (diff)
downloadrtems-f7ba2945d3ce6c27e67ce61091963995a93d3401.tar.bz2
monitor: Add support for BSD wakeup messages
-rw-r--r--cpukit/libmisc/monitor/mon-task.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/cpukit/libmisc/monitor/mon-task.c b/cpukit/libmisc/monitor/mon-task.c
index d2bc16b3ea..1b3c90247d 100644
--- a/cpukit/libmisc/monitor/mon-task.c
+++ b/cpukit/libmisc/monitor/mon-task.c
@@ -23,6 +23,9 @@ rtems_monitor_task_wait_info(
Thread_queue_Context queue_context;
const Thread_queue_Queue *queue;
+ canonical_task->wait_id = 0;
+ canonical_task->wait_name[0] = '\0';
+
_Thread_queue_Context_initialize( &queue_context );
_Thread_Wait_acquire( rtems_thread, &queue_context );
@@ -35,9 +38,20 @@ rtems_monitor_task_wait_info(
sizeof(canonical_task->wait_name),
&canonical_task->wait_id
);
- } else {
- canonical_task->wait_id = 0;
- canonical_task->wait_name[0] = '\0';
+ } else if (
+ (rtems_thread->current_state & STATES_WAITING_FOR_BSD_WAKEUP) != 0
+ ) {
+ const char *wmesg;
+
+ wmesg = rtems_thread->Wait.return_argument_second.immutable_object;
+
+ if (wmesg != NULL) {
+ strlcpy(
+ canonical_task->wait_name,
+ wmesg,
+ sizeof(canonical_task->wait_name)
+ );
+ }
}
_Thread_Wait_release( rtems_thread, &queue_context );