Boost logo

Boost-Commit :

From: anthony_at_[hidden]
Date: 2007-11-26 08:29:16


Author: anthonyw
Date: 2007-11-26 08:29:15 EST (Mon, 26 Nov 2007)
New Revision: 41396
URL: http://svn.boost.org/trac/boost/changeset/41396

Log:
Don't compare native_handle_t against 0 --- do appropriate checks in create_native_thread for platforms where pthread_t is not comparable
Text files modified:
   trunk/libs/thread/test/test_tss.cpp | 14 ++++----------
   1 files changed, 4 insertions(+), 10 deletions(-)

Modified: trunk/libs/thread/test/test_tss.cpp
==============================================================================
--- trunk/libs/thread/test/test_tss.cpp (original)
+++ trunk/libs/thread/test/test_tss.cpp 2007-11-26 08:29:15 EST (Mon, 26 Nov 2007)
@@ -1,5 +1,6 @@
 // Copyright (C) 2001-2003
 // William E. Kempf
+// Copyright (C) 2007 Anthony Williams
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -73,7 +74,7 @@
 
     native_thread_t create_native_thread(void)
     {
- return CreateThread(
+ native_thread_t const res=CreateThread(
             0, //security attributes (0 = not inheritable)
             0, //stack size (0 = default)
             &test_tss_thread_native, //function to execute
@@ -81,6 +82,8 @@
             0, //creation flags (0 = run immediately)
             0 //thread id (0 = thread id not returned)
             );
+ BOOST_CHECK(res!=0);
+ return res;
     }
 
     void join_native_thread(native_thread_t thread)
@@ -154,19 +157,10 @@
     tss_total = 0;
 
     native_thread_t thread1 = create_native_thread();
- BOOST_CHECK(thread1 != 0);
-
     native_thread_t thread2 = create_native_thread();
- BOOST_CHECK(thread2 != 0);
-
     native_thread_t thread3 = create_native_thread();
- BOOST_CHECK(thread3 != 0);
-
     native_thread_t thread4 = create_native_thread();
- BOOST_CHECK(thread3 != 0);
-
     native_thread_t thread5 = create_native_thread();
- BOOST_CHECK(thread3 != 0);
 
     join_native_thread(thread5);
     join_native_thread(thread4);


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk