Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void interrupt timer(){
- if (!c_s_o_d) {
- tick();
- blokirani->vreme();
- }
- if (!c_s_o_d && running->cnt && cntr > 0){ cntr--; }
- if ((cntr==0 && running->cnt) || c_s_o_d) {
- if (lockcont){
- asm {
- mov tsp, sp
- mov tss, ss
- }
- running->sp=tsp;
- running->ss=tss;
- if (running->Terminated==0&&running->status!=terminated&&running->status!=blocked&&running->status!=paused)
- {
- running->status=ready;
- Scheduler::put((PCB *)running);
- }
- running=Scheduler::get();
- if (running==0) {
- running=Deadlock;
- }
- if(running->status!=terminated)
- running->status=runn;
- tsp=running->sp;
- tss=running->ss;
- asm {
- mov sp, tsp
- mov ss, tss
- }
- for(tek=running->sigprvi,preth=0;tek!=0;tek=tek->sled) {
- if (running->handler[tek->sigid]&&(tek->block||(GlobalBlock[tek->sigid]&&running->Block[tek->sigid]))){
- if (tek->sigid==0){
- prekid = running;
- lockcontext();
- unlock();
- running->handler[0]();
- lock();
- unlockcontext();
- asm {
- mov sp, tsp
- mov ss, tss
- }
- break;
- }
- lockcontext();
- unlock();
- running->handler[tek->sigid]();
- lock();
- unlockcontext();
- if(preth) preth->sled=tek->sled;
- else running->sigprvi=tek->sled;
- if(tek->sled==0) running->sigposl=preth;
- }else preth = tek;
- }
- cntr=running->cnt;
- }
- }
- if (!c_s_o_d) asm int 60h
- c_s_o_d = 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement