zencoder/recurrent — comment on commit 7dc802ac9f559775b318bda7fc6dcf9fcfe3cff1
File: lib/recurrent/scheduler.rb line 142
By nate:

You have a race condition here. The value of `@executing_tasks` could change between the end of the `mutex.synchronize` block and the subsequent retrieval of it on this line. As I noted in the comment earlier, the synchronize block should return the last evaluated statement, which should be the value of `@executing_tasks` after `@executing_tasks += 1` executes.