mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-09 23:00:07 +00:00
stdio-common: Add lock optimization to vfprintf and vfwprintf
After the rewrite and the implicit unbuffered streams handling, this is very straightforward to add. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
parent
e88b9f0e5c
commit
3d0005b54a
@ -1452,6 +1452,14 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap, unsigned int mode_flags)
|
||||
return EOF;
|
||||
#endif
|
||||
|
||||
if (!_IO_need_lock (s))
|
||||
{
|
||||
struct Xprintf (buffer_to_file) wrap;
|
||||
Xprintf (buffer_to_file_init) (&wrap, s);
|
||||
Xprintf_buffer (&wrap.base, format, ap, mode_flags);
|
||||
return Xprintf (buffer_to_file_done) (&wrap);
|
||||
}
|
||||
|
||||
int done;
|
||||
|
||||
/* Lock stream. */
|
||||
|
Loading…
Reference in New Issue
Block a user