[libcxx] Follow-up to r292107
authorAsiri Rathnayake <asiri.rathnayake@arm.com>
Mon, 16 Jan 2017 13:13:01 +0000 (13:13 +0000)
committerAsiri Rathnayake <asiri.rathnayake@arm.com>
Mon, 16 Jan 2017 13:13:01 +0000 (13:13 +0000)
I've missed a couple of updates. NFC.

llvm-svn: 292109

libcxx/src/thread.cpp

index 5ccf829..c471b5c 100644 (file)
@@ -40,7 +40,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 thread::~thread()
 {
-    if (__t_ != 0)
+    if (!__libcpp_thread_isnull(&__t_))
         terminate();
 }
 
@@ -48,11 +48,11 @@ void
 thread::join()
 {
     int ec = EINVAL;
-    if (__t_ != 0)
+    if (!__libcpp_thread_isnull(&__t_))
     {
         ec = __libcpp_thread_join(&__t_);
         if (ec == 0)
-            __t_ = 0;
+            __t_ = _LIBCPP_NULL_THREAD;
     }
 
     if (ec)
@@ -63,11 +63,11 @@ void
 thread::detach()
 {
     int ec = EINVAL;
-    if (__t_ != 0)
+    if (!__libcpp_thread_isnull(&__t_))
     {
         ec = __libcpp_thread_detach(&__t_);
         if (ec == 0)
-            __t_ = 0;
+            __t_ = _LIBCPP_NULL_THREAD;
     }
 
     if (ec)