[WTF] RandomDevice should be initialized inside std::call_once
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Jul 2018 04:24:33 +0000 (04:24 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Jul 2018 04:24:33 +0000 (04:24 +0000)
commitcd2a37d6679a722b50e57179da41021b7e862b5c
tree67d23b4e8c8a1a1910b36e75a8f4a85a6f406d57
parent16b8792e25369ad0139076f64848a78725de88ed
[WTF] RandomDevice should be initialized inside std::call_once
https://bugs.webkit.org/show_bug.cgi?id=186017

Reviewed by Darin Adler.

While Linux ports uses mutex-guarded static variables, Mac ports do not.
So we should guard static variables' initialization by using std::call_once.
This patch does it for RandomDevice.

* wtf/OSRandomSource.cpp:
(WTF::cryptographicallyRandomValuesFromOS):
* wtf/RandomDevice.h: Small fix for OS(FUCHSIA).

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233415 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WTF/ChangeLog
Source/WTF/wtf/OSRandomSource.cpp
Source/WTF/wtf/RandomDevice.h