aboutsummaryrefslogtreecommitdiff
path: root/libio/wmemstream.c
diff options
context:
space:
mode:
Diffstat (limited to 'libio/wmemstream.c')
-rw-r--r--libio/wmemstream.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libio/wmemstream.c b/libio/wmemstream.c
index 5bc77f52ee..103a760bf5 100644
--- a/libio/wmemstream.c
+++ b/libio/wmemstream.c
@@ -98,6 +98,9 @@ open_wmemstream (wchar_t **bufloc, _IO_size_t *sizeloc)
new_f->fp.bufloc = bufloc;
new_f->fp.sizeloc = sizeloc;
+ /* Disable single thread optimization. BZ 21735. */
+ new_f->fp._sf._sbf._f._flags2 |= _IO_FLAGS2_NEED_LOCK;
+
return (_IO_FILE *) &new_f->fp._sf._sbf;
}