I have a Task scheduling problem in SysBios (6.33.5.46).
I'm creating a (static) task "InitTask" with the highest priority whose purpose is to initialize some IPC resources (which can't be initialized in main). These resources may be used by any other Task. I want the code to be composable, so instead of blocking all other tasks on a semaphore until the initialization is done, InitTask (the only task at the highest priority) calls Task_disable on entry and Task_restore after it's done with the initializations.
However, when I call Task_restore, the kernel switches to a lower priority Task, instead of continuing in InitTask (which would log some info and exit). At this point the RTOS Object Viewer says InitTask is blocked, the current Task is Running, and all other Tasks are Ready. Later on, my process doesn't exit, apparently because InitTask is still blocked.
BTW, I'm suspicious about the ROS because it claims when I'm in Task_allBlockedFunction, it claims a Task I know has terminated is Running.
So, am I doing something wrong, or is the scheduler broken?
Thanks