Activate uv loop when calling childProcess.fork.

Fixes #156.
This commit is contained in:
Cheng Zhao 2014-01-13 11:52:24 +08:00
parent 84529de10d
commit 290dd36bb0

View file

@ -37,6 +37,13 @@ process.nextTick = wrapWithActivateUvLoop process.nextTick
global.setImmediate = wrapWithActivateUvLoop timers.setImmediate
global.clearImmediate = timers.clearImmediate
# The child_process module also needs to activate the uv loop to make the ipc
# channel setup.
# TODO(zcbenz): Find out why this is needed.
childProcess = require 'child_process'
childProcess.spawn = wrapWithActivateUvLoop childProcess.spawn
childProcess.fork = wrapWithActivateUvLoop childProcess.fork
# Set the __filename to the path of html file if it's file:// protocol.
if window.location.protocol is 'file:'
global.__filename =