summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/char
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2006-03-12 10:34:36 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2006-03-12 10:34:36 +0000
commit354363fb354ac0da1e9a6edd0541ab378242090d (patch)
treea26d322b0d0b77604198fbfe41d3ae4fc5ae3f6d /libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/char
parent9a937ea450dd64ea933873f6f291d0f99430b588 (diff)
downloadgcc-354363fb354ac0da1e9a6edd0541ab378242090d.tar.gz
2006-03-12 Howard Hinnant <hhinnant@apple.com>
* testsuite/27_io/basic_filebuf/underflow/char/10097.cc: Fix race condition. * testsuite/27_io/objects/char/9661-1.cc: Likewise. * testsuite/27_io/objects/wchar_t/9661-1.cc: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111978 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/char')
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/char/10097.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/char/10097.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/char/10097.cc
index 33c72306990..345a6642556 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/char/10097.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/char/10097.cc
@@ -3,7 +3,8 @@
// 2001-05-21 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006
+// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -61,7 +62,7 @@ void test16()
VERIFY( false );
}
- semaphore s1;
+ semaphore s1, s2;
int fval = fork();
if (fval == -1)
{
@@ -72,11 +73,12 @@ void test16()
{
filebuf fbout;
fbout.open(name, ios_base::in|ios_base::out);
- VERIFY ( fbout.is_open() );
+ VERIFY( fbout.is_open() );
fbout.sputn("0123456789", 10);
fbout.pubsync();
- s1.wait ();
+ s1.wait();
fbout.close();
+ s2.signal();
exit(0);
}
@@ -97,7 +99,8 @@ void test16()
}
fb.close();
- s1.signal ();
+ s1.signal();
+ s2.wait();
}
int main()