Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2015
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. void
  2. sched_task_activate_next(struct runtime *dev)
  3. {
  4. → struct task *t = NULL;
  5.  
  6. → if (dev->task_curr) {
  7. → → task_set_state(dev->task_curr, TASK_STATE_PENDING);
  8. → → dd("current state set to PENDING");
  9. → }
  10.  
  11. → t = dev->task_curr + sizeof(struct task);
  12. → if (t > (dev->tasks + (sizeof(struct task) * SCHED_MAX_TASKS)))
  13. → → t = dev->tasks;
  14.  
  15. → if (t != NULL) {
  16. → → dd("next task finded");
  17. → → task_set_state(t, TASK_STATE_RUNNING);
  18. → → dd("next task marked as RUNNING");
  19. → → dev->task_curr = t;
  20. → → dd("next task activated");
  21. → }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement