diff options
author | guenther <> | 2016-04-05 04:29:21 +0000 |
---|---|---|
committer | guenther <> | 2016-04-05 04:29:21 +0000 |
commit | 8d615e14801649271e105df0f420c20902909031 (patch) | |
tree | e8d5ce0d5bf2356480a7a736afad190933d9930c /src/lib/libc/stdlib/random.c | |
parent | a2aa52ba00eccc94337e2f8d54df755b70b64bd6 (diff) | |
download | openbsd-8d615e14801649271e105df0f420c20902909031.tar.gz openbsd-8d615e14801649271e105df0f420c20902909031.tar.bz2 openbsd-8d615e14801649271e105df0f420c20902909031.zip |
Prefer _MUTEX_*LOCK over _THREAD_PRIVATE_MUTEX_*LOCK() when thread-specific
data isn't necessary.
ok mpi@, ok&tweak natano@
Diffstat (limited to 'src/lib/libc/stdlib/random.c')
-rw-r--r-- | src/lib/libc/stdlib/random.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libc/stdlib/random.c b/src/lib/libc/stdlib/random.c index e293648ecd..41d5f64b58 100644 --- a/src/lib/libc/stdlib/random.c +++ b/src/lib/libc/stdlib/random.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: random.c,v 1.29 2015/01/16 16:48:51 deraadt Exp $ */ | 1 | /* $OpenBSD: random.c,v 1.30 2016/04/05 04:29:21 guenther Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 1983 Regents of the University of California. | 3 | * Copyright (c) 1983 Regents of the University of California. |
4 | * All rights reserved. | 4 | * All rights reserved. |
@@ -175,11 +175,11 @@ static int rand_sep = SEP_3; | |||
175 | 175 | ||
176 | static int random_deterministic; | 176 | static int random_deterministic; |
177 | 177 | ||
178 | _THREAD_PRIVATE_MUTEX(random); | 178 | static void *random_mutex; |
179 | static long random_l(void); | 179 | static long random_l(void); |
180 | 180 | ||
181 | #define LOCK() _THREAD_PRIVATE_MUTEX_LOCK(random) | 181 | #define LOCK() _MUTEX_LOCK(&random_mutex) |
182 | #define UNLOCK() _THREAD_PRIVATE_MUTEX_UNLOCK(random) | 182 | #define UNLOCK() _MUTEX_UNLOCK(&random_mutex) |
183 | 183 | ||
184 | /* | 184 | /* |
185 | * srandom: | 185 | * srandom: |