summaryrefslogtreecommitdiff
path: root/node_modules/webworker-threads/test/test08_sigkill_leaks.js
blob: 8b04c47ad3ff76743108a8d31129f1d6e86259cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var Thread= require('webworker-threads');

function cb (e,m) {
  this.destroy();
  console.log('['+this.id+'].destroy()');
  //this.eval('0', cb);
  again();
}


function again () {
  Thread.create().eval('0', cb);
}


var i= +process.argv[2] || 1;
console.log('Using '+ i+ ' threads');



while (i--) {
  again();
}


process.on('exit', function () {
  console.log("process.on('exit') -> BYE!");
});