This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix libstdc++-v2 ends and endl
- To: Ulrich Drepper <drepper at redhat dot com>
- Subject: [PATCH] Fix libstdc++-v2 ends and endl
- From: Jakub Jelinek <jakub at redhat dot com>
- Date: Wed, 18 Oct 2000 18:11:56 +0200
- Cc: gcc-patches at gcc dot gnu dot org
- Reply-To: Jakub Jelinek <jakub at redhat dot com>
Hi!
In May opfx() was added to endl and ends, but opfx acquires the file lock,
so after the first time somebody calls endl or ends, other threads cannot
use that stream.
Ok to commit?
2000-10-18 Jakub Jelinek <jakub@redhat.com>
* iostream.cc (ends): Release the acquired lock.
(endl): Likewise.
--- libio/iostream.cc.jj Wed Oct 11 10:04:22 2000
+++ libio/iostream.cc Wed Oct 18 17:18:34 2000
@@ -965,15 +965,25 @@ int istream::_skip_ws()
ostream& ends(ostream& outs)
{
- if (outs.opfx())
+ if (outs.opfx()) {
+ _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
+ outs._strbuf);
outs.put('\0');
+ outs.osfx();
+ _IO_cleanup_region_end (0);
+ }
return outs;
}
ostream& endl(ostream& outs)
{
- if (outs.opfx())
+ if (outs.opfx()) {
+ _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
+ outs._strbuf);
flush(outs.put('\n'));
+ outs.osfx();
+ _IO_cleanup_region_end (0);
+ }
return outs;
}
Jakub