Use a single worker for status refreshes

There still appear to be crashes occurring when
using libgit2 from multiple workers at the same time.

So only start a new status worker once the current one
completes if a refresh was requested while a worker was
running.

Closes #367
This commit is contained in:
Kevin Sawicki
2013-03-06 14:59:12 -08:00
parent b76ab87a96
commit 8af55a04d8
3 changed files with 42 additions and 3 deletions

View File

@@ -1,3 +1,6 @@
_ = require 'underscore'
EventEmitter = require 'event-emitter'
module.exports =
class Task
aborted: false
@@ -49,3 +52,6 @@ class Task
@abort()
@worker?.terminate()
@worker = null
@trigger 'task-completed'
_.extend Task.prototype, EventEmitter