Skip to contentSkip to conversation

About rt_task_delete()

Xenomai [email protected] 1 participant 1 message Mar 1, 2017

lore
Share & tools
lore
#0 lore raw

I have a task that like this:
func()
{
while(true)

    {
         if(condition == true)
         {
             .............
         }
         else
         {
              rt_task_suspend(NULL);
              printf("resume task\n");  //for test
          }
    }
}

when I call rt_task_delete() to cancel this task in main task, this task will be resumed many times. And most of time no any output, no response directly.
Now, I guess it is because rt_task_suspend() in my program isn't a deemed safe section of code, so xenomai need to resume it to run into a deemed safe section of code.

If it is above this kind of situation , what should I do to avoid? If not, why is that?

System configuration:
debian-8.6, 3.18.46-rt50
Xenomai/mercury v3.0.3
Build args: --with-core=mercury --enable-smp --enable-pshared

Thanks in advance, best regards.

LiuChang