Permalink
Browse files

Seed random number before loading library

For some reason on Windows the random number generators gets seeded
with the same thing every time if you load fibers. I didn't look into
what causes this because we can easily fix it by generating a random
number before loading the library. Perhaps I will look into the root
cause eventually..

Fixes gh-82
  • Loading branch information...
laverdet committed Jun 24, 2012
1 parent ec3997a commit 01937dadb2c07a0c9f983fcdb8f515cd576cc33c
Showing with 3 additions and 0 deletions.
  1. +3 −0 fibers.js
View
@@ -1,5 +1,8 @@
var fs = require('fs'), path = require('path');
+// Seed random numbers [gh-82]
+Math.random();
+
// Look for binary for this platform
var v8 = 'v8-'+ /[0-9]+\.[0-9]+/.exec(process.versions.v8)[0];
var modPath = path.join(__dirname, 'bin', process.platform+ '-'+ process.arch+ '-'+ v8, 'fibers');

0 comments on commit 01937da

Please sign in to comment.