Kévin Petit
0702f2ecee
Make genrand_int32 thread safe ( #1797 )
...
The initialisation code is clearly meant to be run once but the volatile
flag did not guarantee that at all:
- Volatile does not mean atomic and loading the flag vs. other writes
was not safe.
- Multiple threads could have loaded 0 and performed the initialisation
resulting in write collisions.
Rely on std::call_once to provide the guarantee.
This issue was flagged by TSAN.
Signed-off-by: Kévin Petit <kpet@free.fr >
2023-08-19 11:15:17 +01:00
..
2021-05-18 18:09:46 +01:00
2020-07-01 17:30:31 +01:00
2021-01-29 14:18:13 +00:00
2023-06-09 11:25:20 +01:00
2022-10-13 10:02:40 +01:00
2020-10-30 14:13:52 +00:00
2020-05-20 14:16:19 +01:00
2023-06-09 11:25:20 +01:00
2021-09-29 12:38:42 +01:00
2021-09-29 12:38:42 +01:00
2021-09-13 13:25:32 +01:00
2022-11-15 09:18:43 -08:00
2022-11-15 09:18:43 -08:00
2020-09-28 00:26:57 +01:00
2020-09-28 00:26:57 +01:00
2021-05-21 10:07:12 +01:00
2020-10-30 14:13:52 +00:00
2020-10-30 14:13:52 +00:00
2023-04-25 09:16:10 -07:00
2022-08-30 09:47:15 -07:00
2021-08-31 11:45:24 -07:00
2023-03-28 08:57:03 -07:00
2023-03-28 08:57:03 -07:00
2020-10-30 14:13:52 +00:00
2020-10-30 14:13:52 +00:00
2020-10-30 14:13:52 +00:00
2023-08-19 11:15:17 +01:00
2022-09-20 08:52:22 -07:00
2023-04-04 08:12:05 +01:00
2023-04-04 08:12:05 +01:00
2023-04-25 19:30:42 +01:00
2021-06-11 09:42:20 +01:00
2022-10-13 10:02:40 +01:00
2020-09-01 10:16:18 +01:00
2020-10-30 14:13:52 +00:00
2021-05-18 18:10:24 +01:00
2021-05-18 18:10:24 +01:00
2023-07-19 13:47:18 +01:00
2020-10-30 14:13:52 +00:00
2023-06-21 15:19:21 +01:00
2023-04-25 19:30:42 +01:00
2022-11-08 09:32:45 -08:00
2020-10-30 14:13:52 +00:00
2020-10-30 14:13:52 +00:00
2021-06-17 14:05:05 +01:00