Seems you did not change the task priority…
Attached “priority_test.rar” is my testing code.
In low_priority_helloworld.c, I have set the task priority to be 51.
In high_priority_helloworld.c, I have set the task priority to be 50 which is having lower priority than the other one.
If you run the two kernel drivers together, you can check by:
root@fx30:~# ps -eo pid,pri,rtprio,cmd | grep LED
4755 91 51 [LED_flash_threa]
4786 90 50 [LED_flash_threa]
5613 19 - grep LED
I can set the task priority!
Moreover, the high_priority_helloworld printing (dmesg | grep priority) will never be interrupted by another one. It is because I have added the code “local_irq_disable” and “local_irq_enable”.
If I comment out the code “local_irq_disable” and “local_irq_enable” in high_priority_helloworld.c, the high_priority_helloworld printing (dmesg | grep priority) will be interrupted by another one.
I think this can show “local_irq_disable” and “local_irq_enable” are actually working fine to block another task with high priority to interrupt own task.
priority_test.rar (169.7 KB)