mirror of git://gcc.gnu.org/git/gcc.git
1.cc: Join thread before program exits.
2008-09-13 Chris Fairles <chris.fairles@gmail.com>
* testsuite/30_threads/thread/algorithm/1.cc: Join thread before
program exits.
* testsuite/30_threads/thread/algorithm/2.cc: Likewise.
* testsuite/30_threads/thread/this_thread/3.cc: Define test variable.
* testsuite/30_threads/thread/this_thread/4.cc: Likewise.
Co-Authored-By: Benjamin Kosnik <bkoz@redhat.com>
From-SVN: r140338
This commit is contained in:
parent
f35bf7a925
commit
38b5077013
|
|
@ -1,4 +1,12 @@
|
|||
2008-09-12 Chris Fairles <chris.fairles@gmail.com>
|
||||
2008-09-13 Chris Fairles <chris.fairles@gmail.com>
|
||||
|
||||
* testsuite/30_threads/thread/algorithm/1.cc: Join thread before
|
||||
program exits.
|
||||
* testsuite/30_threads/thread/algorithm/2.cc: Likewise.
|
||||
* testsuite/30_threads/thread/this_thread/3.cc: Define test variable.
|
||||
* testsuite/30_threads/thread/this_thread/4.cc: Likewise.
|
||||
|
||||
2008-09-12 Chris Fairles <chris.fairles@gmail.com>
|
||||
Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
* include/std/thread: New.
|
||||
|
|
|
|||
|
|
@ -45,14 +45,16 @@ int main()
|
|||
|
||||
try
|
||||
{
|
||||
std::thread t1(f);
|
||||
std::thread::id t1_id = t1.get_id();
|
||||
|
||||
std::thread t2;
|
||||
t2.swap(std::move(t1));
|
||||
|
||||
VERIFY( t1.get_id() == std::thread::id() );
|
||||
VERIFY( t2.get_id() == t1_id );
|
||||
std::thread t1(f);
|
||||
std::thread::id t1_id = t1.get_id();
|
||||
|
||||
std::thread t2;
|
||||
t2.swap(std::move(t1));
|
||||
|
||||
VERIFY( t1.get_id() == std::thread::id() );
|
||||
VERIFY( t2.get_id() == t1_id );
|
||||
|
||||
t2.join();
|
||||
}
|
||||
catch (const std::system_error&)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -51,6 +51,8 @@ void test01()
|
|||
|
||||
VERIFY( t1.get_id() == std::thread::id() );
|
||||
VERIFY( t2.get_id() == t1_id );
|
||||
|
||||
t2.join();
|
||||
}
|
||||
catch (const std::system_error&)
|
||||
{
|
||||
|
|
@ -73,6 +75,8 @@ void test02()
|
|||
std::swap(std::move(t1), t2);
|
||||
|
||||
VERIFY( t2.get_id() == t1_id );
|
||||
|
||||
t2.join();
|
||||
}
|
||||
catch (const std::system_error&)
|
||||
{
|
||||
|
|
@ -95,6 +99,8 @@ void test03()
|
|||
std::swap(t2, std::move(t1));
|
||||
|
||||
VERIFY( t2.get_id() == t1_id );
|
||||
|
||||
t2.join();
|
||||
}
|
||||
catch (const std::system_error&)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ namespace chr = std::chrono;
|
|||
|
||||
void foo()
|
||||
{
|
||||
bool test __attribute__((unused)) = true;
|
||||
|
||||
chr::system_clock::time_point begin = chr::system_clock::now();
|
||||
chr::microseconds ms(500);
|
||||
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ namespace chr = std::chrono;
|
|||
|
||||
void foo()
|
||||
{
|
||||
bool test __attribute__((unused)) = true;
|
||||
|
||||
chr::system_clock::time_point begin = chr::system_clock::now();
|
||||
chr::microseconds ms(500);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue