From 1b15b6ba0a78e0fe87716cc1df07f092c64dfefb Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Thu, 30 Oct 2025 11:56:05 -0400 Subject: random: Try to ensure rand() state is thread-local Signed-off-by: Andrew Opalach --- src/random.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/random.c b/src/random.c index 1bbf152..fb059a0 100644 --- a/src/random.c +++ b/src/random.c @@ -1,4 +1,8 @@ #include "../include/al/random.h" -u32 al_rand_seed = 1738; +u32 al_rand_seed = AL_RAND_INIT_SEED; + __thread bool al_rand_set = false; +#ifndef AL_SRAND_THREAD_LOCAL +__thread u32 al_rand_state = AL_RAND_INIT_SEED; +#endif -- cgit v1.2.3-101-g0448