2008-09-13 Chris Fairles <chris.fairles@gmail.com>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 13 Sep 2008 09:38:05 +0000 (09:38 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 13 Sep 2008 09:38:05 +0000 (09:38 +0000)
        * 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140338 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/30_threads/thread/algorithm/1.cc
libstdc++-v3/testsuite/30_threads/thread/algorithm/2.cc
libstdc++-v3/testsuite/30_threads/thread/this_thread/3.cc
libstdc++-v3/testsuite/30_threads/thread/this_thread/4.cc

index 249eba7..bd89e6e 100644 (file)
@@ -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.
index 950ffb3..e70bbbb 100644 (file)
@@ -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&)
     {
index f587aac..5dfce53 100644 (file)
@@ -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&)
     {
index 335e410..564bd1f 100644 (file)
@@ -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);
 
index 3612779..54bef5b 100644 (file)
@@ -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);