Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 01937da
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fibers.js
@@ -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');
Expand Down

0 comments on commit 01937da

Please sign in to comment.