Advertisement
Guest User

Xenomai/PSOS race condition t_resume

a guest
Apr 6th, 2014
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.49 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement