I have a low prioritized thread, where I in some cases has to reboot from it. Before I reboot i have to do some preparation, and other higher prioritized tasks should not be able to preempt it while it is preparing to reboot. How can i archive this behavior? I've looked around for a command to disable preemption, but i couldn't find anything. I've tried to use the nilSysLock(), but it seems like i can't execute any code in my task excepting the nilSysUnlock().
Code: Select all
NIL_THREAD(Thread1, arg) {
while (TRUE) {
//Disable preemption here
//Do some shutdown preparing.
//shutdown
//I've tried to use:
nilSysLock();
//Can't execute any of my own code, only the call to nilSysUnlock()
}
}
Hope someone can help, thanks!