Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/Process.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ class Process {
}

setParentQueue(queue) {
this.queue =queue;

}

isFinished() {

return(this.cpuTimedNeeded === 0 && this.blockingTimeNeeded === 0) ? true : false;
}

// If no blocking time is needed by this process, decrement the amount of
Expand All @@ -29,7 +30,13 @@ class Process {
// by emitting the appropriate interrupt
// Make sure the `stateChanged` flag is toggled appropriately
executeProcess(time) {

this.sateChanged = false;
if (this.blockingTimeNee == 0){
this.cpuTimedNeeded = (time > this.cpuTimeNeeded) ? 0 : this.cpTimeNeeded -time
return;
}else{
this.queue.emitInterrupt
}
}

// If this process requires blocking time, decrement the amount of blocking
Expand Down