Guest User

Xenomai/PSOS race condition t_resume

a guest
Apr 6th, 2014
67
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <psos/psos.h>
  4.  
  5. u_long args[] = { 1, 2, 3, 4 };
  6.  
  7. static void root_task(u_long a0, u_long a1, u_long a2, u_long a3)
  8. {
  9.         t_suspend(0);
  10. }
  11.  
  12. int main(int argc, char *const argv[])
  13. {
  14.         do {
  15.                 u_long tid;
  16.                 t_create("root", 1, 0, 0, 0, &tid);
  17.                 t_start(tid, 0, root_task, args);
  18.  
  19.                 tm_wkafter(1000);
  20.                 t_resume(tid);
  21.         } while (1);
  22.  
  23.         exit(0);
  24. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×