Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc')
-rw-r--r--newlib/libc/stdlib/arc4random.h23
1 files changed, 5 insertions, 18 deletions
diff --git a/newlib/libc/stdlib/arc4random.h b/newlib/libc/stdlib/arc4random.h
index 8bb72f40e..54bcbe8ae 100644
--- a/newlib/libc/stdlib/arc4random.h
+++ b/newlib/libc/stdlib/arc4random.h
@@ -37,30 +37,17 @@
#include <sys/lock.h>
#include <signal.h>
-__LOCK_INIT(static, _arc4random_mutex);
+#ifndef _ARC4_LOCK_INIT
-#ifdef __CYGWIN__
-
-extern int __isthreaded;
-
-#define _ARC4_LOCK() \
- do { \
- if (__isthreaded) \
- __lock_acquire (_arc4random_mutex); \
- } while (0)
-
-#define _ARC4_UNLOCK() \
- do { \
- if (__isthreaded) \
- __lock_release (_arc4random_mutex); \
- } while (0)
-#else
+#define _ARC4_LOCK_INIT __LOCK_INIT(static, _arc4random_mutex);
#define _ARC4_LOCK() __lock_acquire(_arc4random_mutex)
#define _ARC4_UNLOCK() __lock_release(_arc4random_mutex)
-#endif
+#endif /* _ARC4_LOCK_INIT */
+
+_ARC4_LOCK_INIT
#ifdef _ARC4RANDOM_DATA
_ARC4RANDOM_DATA