projects
/
platform
/
upstream
/
nodejs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a8506c4
)
Change isolate test to demo EIO bug
author
Ryan Dahl
<ry@tinyclouds.org>
Mon, 19 Dec 2011 07:39:49 +0000
(23:39 -0800)
committer
Ryan Dahl
<ry@tinyclouds.org>
Tue, 27 Dec 2011 20:54:23 +0000
(12:54 -0800)
test/simple/test-isolates.js
patch
|
blob
|
history
diff --git
a/test/simple/test-isolates.js
b/test/simple/test-isolates.js
index
15b643e
..
810ae95
100644
(file)
--- a/
test/simple/test-isolates.js
+++ b/
test/simple/test-isolates.js
@@
-1,4
+1,5
@@
var fs = require('fs');
var fs = require('fs');
+var http = require('http');
console.log("count: %d", process._countIsolate());
console.log("count: %d", process._countIsolate());
@@
-7,21
+8,31
@@
if (process.tid === 1) {
//process._joinIsolate(isolate);
console.error("master");
fs.stat(__dirname, function(err, stat) {
//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) {
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());
}
console.error("thread 2 count: %d", process._countIsolate());
}