diff options
| author | 2025-10-30 11:56:05 -0400 | |
|---|---|---|
| committer | 2025-10-30 11:56:05 -0400 | |
| commit | 1b15b6ba0a78e0fe87716cc1df07f092c64dfefb (patch) | |
| tree | c784e9a4a39521f00a62723bfa2aa85850bd081d /src | |
| parent | 00c292b5bd4f6cf24287c7581d54a60f4b6fdcb7 (diff) | |
| download | libalabaster-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.c | 6 |
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 |