Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

surround a bunch of stuff with domains.enable branches

  • Loading branch information
ry committed Sep 19, 2011
1 parent b8023a7 commit 7d5b38e713114ab8c4909e8acef25ff8e2239977
Showing with 9 additions and 5 deletions.
  1. +4 −0 lib/domains.js
  2. +4 −4 lib/net_uv.js
  3. +1 −1 lib/timers_uv.js
@@ -26,6 +26,8 @@ var util = require('util');
var domainIds = 0;
var allowBadHandleAccess = false;

exports.enabled = false;


var debug;
if (process.env.NODE_DEBUG && /domain/.test(process.env.NODE_DEBUG)) {
@@ -184,6 +186,8 @@ exports.remove = function(handle) {


exports.create = function(arg, cb) {
exports.enabled = true;
console.error("DOMAINS ENABLED");
var d = new Domain();
d.cb = cb;
d.arg = arg;
@@ -9,15 +9,15 @@ var domains = require('domains');
function createPipe() {
var Pipe = process.binding('pipe_wrap').Pipe;
var pipe = new Pipe();
domains.add(pipe);
if (domains.enabled) domains.add(pipe);
return pipe;
}

// constructor for lazy loading
function createTCP() {
var TCP = process.binding('tcp_wrap').TCP;
var tcp = new TCP();
domains.add(tcp);
if (domains.enabled) domains.add(tcp);
return tcp;
}

@@ -44,12 +44,12 @@ function isPipeName(s) {

function close(handle) {
handle.close();
domains.remove(handle);
if (domains.enabled) domains.remove(handle);
}


function closeReq(req) {
domains.remove(req);
if (domains.enabled) domains.remove(req);
}


@@ -34,7 +34,7 @@ if (process.env.NODE_DEBUG && /timer/.test(process.env.NODE_DEBUG)) {

function closeTimer(t) {
t.close();
domains.remove(t);
if (domains.enabled) domains.remove(t);
}


0 comments on commit 7d5b38e

Please sign in to comment.
You can’t perform that action at this time.