[PATCH 2/3, newlib] Only define static locks in multithreaded mode

Thomas Preudhomme thomas.preudhomme@foss.arm.com
Tue Jan 31 17:10:00 GMT 2017


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

Is this ok for master?

Best regards,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: guard_static_lock_single_thread.patch
Type: text/x-patch
Size: 5314 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20170131/46841ecd/attachment.bin>

More information about the Newlib mailing list