0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 07:27:22 +01:00
nodejs/test/mjsunit/test-eio-race2.js
Ryan Dahl f80cc69c23 libeio bugfix part 3
Finally (hopefully) fix the issue that Felix reported. It's only appearing
on macintosh (test/mjsunit/test-eio-race3.js)

The trick/hack is to call eio_poll() again before reentering the event loop.

Additionally this commit implements a more complex method of calling
eio_poll(), occasionally dropping to an ev_idle watcher.

See also:
3f39772834
http://lists.schmorp.de/pipermail/libev/2010q1/000855.html
http://groups.google.com/group/nodejs/browse_thread/thread/9f8db11c792a68bb/a89705f68971f53c
2010-01-06 01:27:31 -08:00

21 lines
477 B
JavaScript

process.mixin(require("./common"));
var testTxt = path.join(fixturesDir, "x.txt");
var posix = require('posix');
setTimeout(function () {
// put this in a timeout, just so it doesn't get bunched up with the
// require() calls..
N = 30;
for (var i=0; i < N; i++) {
puts("start " + i);
posix.cat(testTxt).addCallback(function(data) {
puts("finish");
}).addErrback(function (e) {
puts("error! " + e);
process.exit(1);
});
}
}, 100);