Created
July 1, 2018 19:02
-
-
Save wallstop/4f3794d0d1525375be565296964c1b6b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Ship | |
private boolean _done; | |
boolean isDone() { // Dock spin-loops on this | |
return _done; | |
} | |
void startJobs() { | |
if(jobQueue.isEmpty()) { | |
_done = true; | |
return; | |
} | |
for(Job job : jobQueue) { | |
job.start(); | |
while(!job.done()) { | |
Thread.Sleep(SomeTime); | |
} | |
print("job's done!"); | |
} | |
_done = true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment