This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

modify task_param

Other Parts Discussed in Thread: SYSBIOS

hi all, 

     i am using the latest sysbios and mcsdk. I am running on ubuntu 14. I am porting some old code into the C6678 processors. i want to minimize change to my code. So one thing i have to figure out is to name thread and give the thread an ID number. So i want to give a string name and an integer threadID to task, swi or HWI. I think we can use Task_Param.instance( IInstance ) to achieve that goal. So i wonder i am allowed to modify IInstance.h , the default struct in that file is

struct xdc_runtime_IInstance_Params {
size_t __size;
xdc_String name;
};

 I want to change to struct xdc_runtime_IInstance_Params {
size_t __size;

UInt16 threadID;

xdc_String name;
};

can I safely do that without consequences?

  • Hi wei chen20,

    We do not recommend for users to change our predefined interfaces. It makes it hard to support, especially when you upgrade in the future. I'd suggest you append the thread ID to the name. E.g. for Tasks:

    Task_Params taskParams;

    // Create task
    Task_Params_init(&taskParams);
    taskParams.instance->name = "myTsk0";
    Task_create((Task_FuncPtr)myFxn, &taskParams, &eb);

    Alternatively, depending on what you want to achieve, you can also pass the thread id to the thread as an argument in its creation parameters.

    Best regards,
    Vincent