From 95868042f60faa7ca63474e39358dbce5fb57895 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Thu, 13 Jan 2011 13:40:09 -0500 Subject: [PATCH] seed random number generator with PID and time --- modes/Spin.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modes/Spin.cc b/modes/Spin.cc index ce1649d..29909a4 100644 --- a/modes/Spin.cc +++ b/modes/Spin.cc @@ -2,6 +2,8 @@ #include #include #include +#include +#include #include #include @@ -13,7 +15,7 @@ Spin::Spin() m_num_monitors = 1; m_monitor_info = new monitor_info_t[m_num_monitors]; m_last_ticks = 0; - srand(time(NULL)); + srand(time(NULL) + getpid()); initMonitorInfo(); }