Skip to content
Snippets Groups Projects
Commit 5a7932c3 authored by Philippe Canal's avatar Philippe Canal
Browse files

rand and random are not thread safe

parent 9612826f
No related branches found
No related tags found
No related merge requests found
......@@ -138,6 +138,8 @@ TUUID::TUUID()
static TTHREAD_TLS(UShort_t) clockseq;
static TTHREAD_TLS(Bool_t) firstTime = kTRUE;
if (firstTime) {
R__LOCKGUARD2(gROOTMutex); // rand and random are not thread safe.
if (gSystem) {
// try to get a unique seed per process
UInt_t seed = (UInt_t) (Long64_t(gSystem->Now()) + gSystem->GetPid());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment