Summary:
Remove global initialization of ThreadLocal in Random
See https://gcc.gnu.org/onlinedocs/gcc-4.8.3/gcc/Thread-Local.html
Static initializers and thread locals don't mix well, and we're seeing
some crashes which we think might be related to this.
Test Plan: Unit tests
Reviewed By: seanc@fb.com
Subscribers: trunkagent, seanc, njormrod
FB internal diff:
D1617455
ptr_ += size;
}
-ThreadLocal<BufferedRandomDevice> bufferedRandomDevice;
} // namespace
void Random::secureRandom(void* data, size_t size) {
+ static ThreadLocal<BufferedRandomDevice> bufferedRandomDevice;
bufferedRandomDevice->get(data, size);
}