From 01937dadb2c07a0c9f983fcdb8f515cd576cc33c Mon Sep 17 00:00:00 2001 From: Marcel Laverdet Date: Sun, 24 Jun 2012 08:08:37 -0500 Subject: [PATCH] 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 --- fibers.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fibers.js b/fibers.js index bc81ec7..ce5cf15 100644 --- a/fibers.js +++ b/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');