diff options
author | bcook <bcook@cvs.openbsd.org> | 2014-07-19 14:34:39 +0000 |
---|---|---|
committer | bcook <bcook@cvs.openbsd.org> | 2014-07-19 14:34:39 +0000 |
commit | f1da3cf8c1d2c2fe840fab84ed76f18554e43d04 (patch) | |
tree | d8dda17785bab4eb7bf909fc27d6a59ada6f6ba0 /lib/libcrypto/crypto/arc4random_linux.h | |
parent | af4a23e90aab863f33c8cd26d64fdf403ddcc2bd (diff) |
move _ARC4_LOCK/UNLOCK primitives from thread_private into OS-specific modules
Diffstat (limited to 'lib/libcrypto/crypto/arc4random_linux.h')
-rw-r--r-- | lib/libcrypto/crypto/arc4random_linux.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/libcrypto/crypto/arc4random_linux.h b/lib/libcrypto/crypto/arc4random_linux.h index 992ee6bb8ef..29dad3b9adf 100644 --- a/lib/libcrypto/crypto/arc4random_linux.h +++ b/lib/libcrypto/crypto/arc4random_linux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: arc4random_linux.h,v 1.4 2014/07/19 13:02:28 bcook Exp $ */ +/* $OpenBSD: arc4random_linux.h,v 1.5 2014/07/19 14:34:38 bcook Exp $ */ /* * Copyright (c) 1996, David Mazieres <dm@uun.org> @@ -22,6 +22,12 @@ * Stub functions for portability. */ +#include <pthread.h> + +static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER; +#define _ARC4_LOCK() pthread_mutex_lock(&arc4random_mtx) +#define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx) + static volatile sig_atomic_t _rs_forked; static inline void |