diff options
| author | bcook <> | 2014-07-19 14:34:38 +0000 | 
|---|---|---|
| committer | bcook <> | 2014-07-19 14:34:38 +0000 | 
| commit | 8323938cd69c84c53e1c31b179623d9c20175393 (patch) | |
| tree | 81f4ca41c2f27aef1cad110b62bd34876092913f /src/lib/libcrypto/arc4random/arc4random_linux.h | |
| parent | 7fb2af12ce2778416f758df6e30e9932b1909167 (diff) | |
| download | openbsd-8323938cd69c84c53e1c31b179623d9c20175393.tar.gz openbsd-8323938cd69c84c53e1c31b179623d9c20175393.tar.bz2 openbsd-8323938cd69c84c53e1c31b179623d9c20175393.zip | |
move _ARC4_LOCK/UNLOCK primitives from thread_private into OS-specific modules
Diffstat (limited to 'src/lib/libcrypto/arc4random/arc4random_linux.h')
| -rw-r--r-- | src/lib/libcrypto/arc4random/arc4random_linux.h | 8 | 
1 files changed, 7 insertions, 1 deletions
| diff --git a/src/lib/libcrypto/arc4random/arc4random_linux.h b/src/lib/libcrypto/arc4random/arc4random_linux.h index 992ee6bb8e..29dad3b9ad 100644 --- a/src/lib/libcrypto/arc4random/arc4random_linux.h +++ b/src/lib/libcrypto/arc4random/arc4random_linux.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: arc4random_linux.h,v 1.4 2014/07/19 13:02:28 bcook Exp $ */ | 1 | /* $OpenBSD: arc4random_linux.h,v 1.5 2014/07/19 14:34:38 bcook Exp $ */ | 
| 2 | 2 | ||
| 3 | /* | 3 | /* | 
| 4 | * Copyright (c) 1996, David Mazieres <dm@uun.org> | 4 | * Copyright (c) 1996, David Mazieres <dm@uun.org> | 
| @@ -22,6 +22,12 @@ | |||
| 22 | * Stub functions for portability. | 22 | * Stub functions for portability. | 
| 23 | */ | 23 | */ | 
| 24 | 24 | ||
| 25 | #include <pthread.h> | ||
| 26 | |||
| 27 | static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER; | ||
| 28 | #define _ARC4_LOCK() pthread_mutex_lock(&arc4random_mtx) | ||
| 29 | #define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx) | ||
| 30 | |||
| 25 | static volatile sig_atomic_t _rs_forked; | 31 | static volatile sig_atomic_t _rs_forked; | 
| 26 | 32 | ||
| 27 | static inline void | 33 | static inline void | 
