Browse Source

move _ARC4_LOCK/UNLOCK primitives from thread_private into OS-specific modules

OPENBSD_5_6
bcook 10 years ago
parent
commit
b61a1138bd
6 changed files with 44 additions and 6 deletions
  1. +7
    -1
      src/lib/libcrypto/arc4random/arc4random_linux.h
  2. +7
    -1
      src/lib/libcrypto/arc4random/arc4random_osx.h
  3. +8
    -1
      src/lib/libcrypto/arc4random/arc4random_solaris.h
  4. +7
    -1
      src/lib/libcrypto/crypto/arc4random_linux.h
  5. +7
    -1
      src/lib/libcrypto/crypto/arc4random_osx.h
  6. +8
    -1
      src/lib/libcrypto/crypto/arc4random_solaris.h

+ 7
- 1
src/lib/libcrypto/arc4random/arc4random_linux.h View File

@ -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


+ 7
- 1
src/lib/libcrypto/arc4random/arc4random_osx.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: arc4random_osx.h,v 1.4 2014/07/19 13:02:28 bcook Exp $ */
/* $OpenBSD: arc4random_osx.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


+ 8
- 1
src/lib/libcrypto/arc4random/arc4random_solaris.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: arc4random_solaris.h,v 1.4 2014/07/19 13:02:28 bcook Exp $ */
/* $OpenBSD: arc4random_solaris.h,v 1.5 2014/07/19 14:34:38 bcook Exp $ */
/*
* Copyright (c) 1996, David Mazieres <dm@uun.org>
@ -21,6 +21,13 @@
/*
* 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


+ 7
- 1
src/lib/libcrypto/crypto/arc4random_linux.h View File

@ -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


+ 7
- 1
src/lib/libcrypto/crypto/arc4random_osx.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: arc4random_osx.h,v 1.4 2014/07/19 13:02:28 bcook Exp $ */
/* $OpenBSD: arc4random_osx.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


+ 8
- 1
src/lib/libcrypto/crypto/arc4random_solaris.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: arc4random_solaris.h,v 1.4 2014/07/19 13:02:28 bcook Exp $ */
/* $OpenBSD: arc4random_solaris.h,v 1.5 2014/07/19 14:34:38 bcook Exp $ */
/*
* Copyright (c) 1996, David Mazieres <dm@uun.org>
@ -21,6 +21,13 @@
/*
* 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


Loading…
Cancel
Save