Module: xenomai-3
Branch: next
Commit: f84438b273aed9cf10284b5f090199dd913d9dd0
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=f84438b273aed9cf10284b5f090199dd913d9dd0

Author: Philippe Gerum <r...@xenomai.org>
Date:   Tue Mar 24 18:29:55 2015 +0100

vxworks/task: use name generator for anon tasks

---

 lib/vxworks/taskLib.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/lib/vxworks/taskLib.c b/lib/vxworks/taskLib.c
index 6492d62..ddb7df6 100644
--- a/lib/vxworks/taskLib.c
+++ b/lib/vxworks/taskLib.c
@@ -49,7 +49,8 @@ pthread_mutex_t wind_task_lock;
 
 int wind_time_slice = 0;
 
-static unsigned long anon_tids;
+static DEFINE_NAME_GENERATOR(task_namegen, "task",
+                            struct wind_task, name);
 
 static struct wind_task *find_wind_task(TASK_ID tid)
 {
@@ -349,10 +350,7 @@ static STATUS __taskInit(struct wind_task *task,
        tcb->flags = flags;
        tcb->entry = entry;
 
-       if (name == NULL || *name == '\0')
-               sprintf(task->name, "t%lu", ++anon_tids);
-       else
-               namecpy(task->name, name);
+       generate_name(task->name, name, &task_namegen);
 
        idata.magic = task_magic;
        idata.finalizer = task_finalizer;


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

Reply via email to