joyent/node — Issue #2665: isolates require dubbel exit call
Author: AndreasMadsen
Created: 2012-02-01 20:16:38+00:00
State: open

Testcase:

```JavaScript
var fork = require('child_process').fork;

if (process.argv[2] === 'child') {
setInterval(function () {
console.log('alive ... ');
}, 200);

setTimeout(function () {
console.log('exit child');
process.exit(0);
}, 500);
} else {
var child = fork(process.argv[1], ['child'], {thread: true});
}
```

Output:

```shell
> out/Release/node child/test6
alive ...
alive ...
exit child
alive ...
alive ...
alive ...
alive ...
alive ...
alive ...
alive ...
alive ...
^C
```

The child should die at `exit child` but do not.
However if using two `process.exit(0)` it do work:

```JavaScript
setTimeout(function () {
console.log('exit child');
process.exit(0);
}, 500);
```