How can i change the thread name which is dynamically created ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can i change the thread name which is dynamically created ?

445 Views
chethanpandi
Contributor I

If change the name of one thread, it will change the name of the all threads dynamically created.

Ex : There are two threads T1 and T2. T1 is first creted, then T2 with same priority.

        If i change the name of T1 using template pointer, T2 name also get change to common name.

Please let me know with some solutions.

Tags (3)
0 Kudos
2 Replies

318 Views
chethanpandi
Contributor I

Yes, i able to renaming the thread dynamically. But if i created threads dynamically by defining task template in local scope, with task index 0 and parameter as pointer to task template, if first thread renamed it renames all threads with common name.

If I rename the thread created from task template, with application-unique numbers, only that specified thread name only changed.

I followed below pseudo code to rename the thread,

TASK_TEMPLATE_STRUCT_PTR template_ptr;

template_ptr = _task_get_template_ptr(tid);

strcpy(template_ptr->TASK_NAME, "new_name");

0 Kudos

318 Views
RadekS
NXP Employee
NXP Employee

I suppose that you want change MQX tasks name (task=thread). Correct?

Could you please closer specify how did you change task name by template pointer?

Did you create new template list in RAM (copy of old one), edit names in this table and change pointer in MQX_init_struct to this new template list? Or you renamed tasks different way?

Which version of MQX you use?

0 Kudos