Module: xenomai-forge
Branch: rtdm-api-waitqueues
Commit: fa57bc3af40fe190d52a6773cd1f0ceaf8700400
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=fa57bc3af40fe190d52a6773cd1f0ceaf8700400

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu Apr 17 10:49:44 2014 +0200

cobalt/thread: add square brackets to kernel thread names

---

 kernel/cobalt/thread.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/kernel/cobalt/thread.c b/kernel/cobalt/thread.c
index 25cc353..fa5f0b4 100644
--- a/kernel/cobalt/thread.c
+++ b/kernel/cobalt/thread.c
@@ -158,9 +158,12 @@ int __xnthread_init(struct xnthread *thread,
        }
 
        if (attr->name)
-               xnobject_copy_name(thread->name, attr->name);
+               snprintf(thread->name,
+                        sizeof(thread->name), flags & XNUSER ?
+                        "%s" : "[%s]", attr->name);
        else
-               snprintf(thread->name, sizeof(thread->name), "%p", thread);
+               snprintf(thread->name,
+                        sizeof(thread->name), "[%p]", thread);
 
        thread->personality = attr->personality;
        cpus_and(thread->affinity, attr->affinity, nkaffinity);


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to