summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbcook <>2014-07-19 14:34:38 +0000
committerbcook <>2014-07-19 14:34:38 +0000
commit4fc69ca9a67a87b95cea7c588f60bcdd09e3e14f (patch)
tree81f4ca41c2f27aef1cad110b62bd34876092913f /src
parentd9cd3809979ad097af843b89445c42701190f8df (diff)
downloadopenbsd-4fc69ca9a67a87b95cea7c588f60bcdd09e3e14f.tar.gz
openbsd-4fc69ca9a67a87b95cea7c588f60bcdd09e3e14f.tar.bz2
openbsd-4fc69ca9a67a87b95cea7c588f60bcdd09e3e14f.zip
move _ARC4_LOCK/UNLOCK primitives from thread_private into OS-specific modules
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/arc4random/arc4random_linux.h8
-rw-r--r--src/lib/libcrypto/arc4random/arc4random_osx.h8
-rw-r--r--src/lib/libcrypto/arc4random/arc4random_solaris.h9
-rw-r--r--src/lib/libcrypto/crypto/arc4random_linux.h8
-rw-r--r--src/lib/libcrypto/crypto/arc4random_osx.h8
-rw-r--r--src/lib/libcrypto/crypto/arc4random_solaris.h9
6 files changed, 44 insertions, 6 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
27static 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
25static volatile sig_atomic_t _rs_forked; 31static volatile sig_atomic_t _rs_forked;
26 32
27static inline void 33static inline void
diff --git a/src/lib/libcrypto/arc4random/arc4random_osx.h b/src/lib/libcrypto/arc4random/arc4random_osx.h
index 274288000f..55932bb823 100644
--- a/src/lib/libcrypto/arc4random/arc4random_osx.h
+++ b/src/lib/libcrypto/arc4random/arc4random_osx.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: arc4random_osx.h,v 1.4 2014/07/19 13:02:28 bcook Exp $ */ 1/* $OpenBSD: arc4random_osx.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
27static 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
25static volatile sig_atomic_t _rs_forked; 31static volatile sig_atomic_t _rs_forked;
26 32
27static inline void 33static inline void
diff --git a/src/lib/libcrypto/arc4random/arc4random_solaris.h b/src/lib/libcrypto/arc4random/arc4random_solaris.h
index 128f61e003..e5ebbfb7e5 100644
--- a/src/lib/libcrypto/arc4random/arc4random_solaris.h
+++ b/src/lib/libcrypto/arc4random/arc4random_solaris.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: arc4random_solaris.h,v 1.4 2014/07/19 13:02:28 bcook Exp $ */ 1/* $OpenBSD: arc4random_solaris.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>
@@ -21,6 +21,13 @@
21/* 21/*
22 * Stub functions for portability. 22 * Stub functions for portability.
23 */ 23 */
24
25#include <pthread.h>
26
27static 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
24static volatile sig_atomic_t _rs_forked; 31static volatile sig_atomic_t _rs_forked;
25 32
26static inline void 33static inline void
diff --git a/src/lib/libcrypto/crypto/arc4random_linux.h b/src/lib/libcrypto/crypto/arc4random_linux.h
index 992ee6bb8e..29dad3b9ad 100644
--- a/src/lib/libcrypto/crypto/arc4random_linux.h
+++ b/src/lib/libcrypto/crypto/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
27static 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
25static volatile sig_atomic_t _rs_forked; 31static volatile sig_atomic_t _rs_forked;
26 32
27static inline void 33static inline void
diff --git a/src/lib/libcrypto/crypto/arc4random_osx.h b/src/lib/libcrypto/crypto/arc4random_osx.h
index 274288000f..55932bb823 100644
--- a/src/lib/libcrypto/crypto/arc4random_osx.h
+++ b/src/lib/libcrypto/crypto/arc4random_osx.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: arc4random_osx.h,v 1.4 2014/07/19 13:02:28 bcook Exp $ */ 1/* $OpenBSD: arc4random_osx.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
27static 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
25static volatile sig_atomic_t _rs_forked; 31static volatile sig_atomic_t _rs_forked;
26 32
27static inline void 33static inline void
diff --git a/src/lib/libcrypto/crypto/arc4random_solaris.h b/src/lib/libcrypto/crypto/arc4random_solaris.h
index 128f61e003..e5ebbfb7e5 100644
--- a/src/lib/libcrypto/crypto/arc4random_solaris.h
+++ b/src/lib/libcrypto/crypto/arc4random_solaris.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: arc4random_solaris.h,v 1.4 2014/07/19 13:02:28 bcook Exp $ */ 1/* $OpenBSD: arc4random_solaris.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>
@@ -21,6 +21,13 @@
21/* 21/*
22 * Stub functions for portability. 22 * Stub functions for portability.
23 */ 23 */
24
25#include <pthread.h>
26
27static 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
24static volatile sig_atomic_t _rs_forked; 31static volatile sig_atomic_t _rs_forked;
25 32
26static inline void 33static inline void