[PATCH] Disable single thread optimization for open_memstream

Szabolcs Nagy szabolcs.nagy@arm.com
Fri Jul 14 13:01:00 GMT 2017


Single thread optimization is valid if at thread creation time the
optimization can be disabled.  This is in principle true for all
stream objects that user code can access (and thus needs locking),
using the same internal list as fflush(0) uses.  However in glibc
open_memstream is not on that list (BZ 21735) so the optimization
has to be disabled.

OK with the test?

2017-07-14  Szabolcs Nagy  <szabolcs.nagy@arm.com>
	    Florian Weimer  <fweimer@redhat.com>

	* libio/memstream.c (__open_memstream): Set _IO_FLAGS2_NEED_LOCK.
	* libio/wmemstream.c (open_wmemstream): Likewise.
	* nptl/tst-memstream.c: New.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stdio3.diff
Type: text/x-patch
Size: 4100 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20170714/ac8ea663/attachment.bin>


More information about the Libc-alpha mailing list