summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2025-10-30 11:56:05 -0400
committerAndrew Opalach <andrew@akon.city> 2025-10-30 11:56:05 -0400
commit1b15b6ba0a78e0fe87716cc1df07f092c64dfefb (patch)
treec784e9a4a39521f00a62723bfa2aa85850bd081d /src
parent00c292b5bd4f6cf24287c7581d54a60f4b6fdcb7 (diff)
downloadlibalabaster-1b15b6ba0a78e0fe87716cc1df07f092c64dfefb.tar.gz
libalabaster-1b15b6ba0a78e0fe87716cc1df07f092c64dfefb.tar.bz2
libalabaster-1b15b6ba0a78e0fe87716cc1df07f092c64dfefb.zip
random: Try to ensure rand() state is thread-local
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src')
-rw-r--r--src/random.c6
1 files changed, 5 insertions, 1 deletions
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