dart-lang/spark — pull request #2675 by ussuri (2014-06-23 22:44:55+00:00)
Title: Fix race condition that made it possible for N jobs to start simultaneously

@devoncarew
cc @dinhviethoa

This also fixes #2293, the sporadically disappearing "Getting packages..." message upon creation of a new project with some Bower or Pub packages (more pronounced for Bower, because project templates that have Pub dependencies have very few of them).

A candidate to be merged into 0.13.

The bug was that the `_runningJob` "mutex" was set in an asynchronously run `_runNextJob`. So while one job was still getting launched, another job could come, observe the mutex seemingly unlocked, and also start launching.