diff options
author | Thomas Preud'homme <thomas.preudhomme@arm.com> | 2017-01-30 11:23:00 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2017-02-13 17:04:17 -0500 |
commit | fa55c610facaae12e38d90d14e44fecd1259b3ab (patch) | |
tree | ce19e155be44925f8bd7ed33b501cc414b47f3d2 /newlib/libc/stdlib/arc4random.h | |
parent | af272aca591fe1dc0f1be64ae5bda147ea98a047 (diff) | |
download | newlib-fa55c610facaae12e38d90d14e44fecd1259b3ab.zip newlib-fa55c610facaae12e38d90d14e44fecd1259b3ab.tar.gz newlib-fa55c610facaae12e38d90d14e44fecd1259b3ab.tar.bz2 |
Only define static locks in multithreaded mode
Newlib build system defines __SINGLE_THREAD__ to allow concurrency code
to be only compiled when newlib is configured for multithread. One such
example are locks which become useless in single thread mode. Although
most static locks are indeed guarded by !defined(__SINGLE_THREAD__),
some are not.
This commit adds these missing guards to __dd_hash_mutex,
__atexit_recursive_mutex, __at_quick_exit_mutex and __arc4random_mutex.
It also makes sure locking macros in lock.h are noop in single thread
mode.
Diffstat (limited to 'newlib/libc/stdlib/arc4random.h')
-rw-r--r-- | newlib/libc/stdlib/arc4random.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/newlib/libc/stdlib/arc4random.h b/newlib/libc/stdlib/arc4random.h index 3c5fe23..4b98553 100644 --- a/newlib/libc/stdlib/arc4random.h +++ b/newlib/libc/stdlib/arc4random.h @@ -47,7 +47,9 @@ #endif /* _ARC4_LOCK_INIT */ +#ifndef __SINGLE_THREAD__ _ARC4_LOCK_INIT +#endif #ifdef _ARC4RANDOM_DATA _ARC4RANDOM_DATA |