Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. void interrupt timer(){
  2. if (!c_s_o_d) {
  3. tick();
  4. blokirani->vreme();
  5. }
  6. if (!c_s_o_d && running->cnt && cntr > 0){ cntr--; }
  7. if ((cntr==0 && running->cnt) || c_s_o_d) {
  8. if (lockcont){
  9. asm {
  10. mov tsp, sp
  11. mov tss, ss
  12. }
  13. running->sp=tsp;
  14. running->ss=tss;
  15. if (running->Terminated==0&&running->status!=terminated&&running->status!=blocked&&running->status!=paused)
  16. {
  17. running->status=ready;
  18. Scheduler::put((PCB *)running);
  19. }
  20. running=Scheduler::get();
  21. if (running==0) {
  22. running=Deadlock;
  23. }
  24. if(running->status!=terminated)
  25. running->status=runn;
  26.  
  27. tsp=running->sp;
  28. tss=running->ss;
  29. asm {
  30. mov sp, tsp
  31. mov ss, tss
  32. }
  33. for(tek=running->sigprvi,preth=0;tek!=0;tek=tek->sled) {
  34. if (running->handler[tek->sigid]&&(tek->block||(GlobalBlock[tek->sigid]&&running->Block[tek->sigid]))){
  35. if (tek->sigid==0){
  36. prekid = running;
  37. lockcontext();
  38. unlock();
  39. running->handler[0]();
  40. lock();
  41. unlockcontext();
  42. asm {
  43. mov sp, tsp
  44. mov ss, tss
  45. }
  46. break;
  47. }
  48. lockcontext();
  49. unlock();
  50. running->handler[tek->sigid]();
  51. lock();
  52. unlockcontext();
  53. if(preth) preth->sled=tek->sled;
  54. else running->sigprvi=tek->sled;
  55. if(tek->sled==0) running->sigposl=preth;
  56. }else preth = tek;
  57. }
  58. cntr=running->cnt;
  59. }
  60. }
  61. if (!c_s_o_d) asm int 60h
  62. c_s_o_d = 0;
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement