Skip to content

Instantly share code, notes, and snippets.

@wallstop
Created July 1, 2018 19:02
Show Gist options
  • Save wallstop/4f3794d0d1525375be565296964c1b6b to your computer and use it in GitHub Desktop.
Save wallstop/4f3794d0d1525375be565296964c1b6b to your computer and use it in GitHub Desktop.
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