Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Change isolate test to demo EIO bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Dec 21, 2011
1 parent 3846af6 commit 46582ad
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions test/simple/test-isolates.js
@@ -1,4 +1,5 @@
var fs = require('fs');
var http = require('http');

console.log("count: %d", process._countIsolate());

Expand All @@ -7,21 +8,31 @@ if (process.tid === 1) {
//process._joinIsolate(isolate);
console.error("master");
fs.stat(__dirname, function(err, stat) {
if (err) {
console.error("thread 1 error!");
throw err;
}
console.error('thread 1', stat);
if (err) throw err;
console.error('thread 1', stat.mtime);
});

setTimeout(function() {
fs.stat(__dirname, function(err, stat) {
if (err) throw err;
console.error('thread 1', stat.mtime);
});
}, 500);

console.log("thread 1 count: %d", process._countIsolate());
} else {
console.error("slave");
fs.stat(__dirname, function(err, stat) {
if (err) {
console.error("thread 2 error!");
throw err;
}
console.error('thread 2', stat);
if (err) throw err;
console.error('thread 2', stat.mtime);
});

setTimeout(function() {
fs.stat(__dirname, function(err, stat) {
if (err) throw err;
console.error('thread 2', stat.mtime);
});
}, 500);

console.error("thread 2 count: %d", process._countIsolate());
}

0 comments on commit 46582ad

Please sign in to comment.