From ba5172cccb57a5125ee1e63fb5f1b56c38e7474c Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 9 Mar 2014 22:26:36 +0100 Subject: [PATCH] pthread: allow NULL thread to compare equal. - POSIX says the behavior for pthread_equal is undefined for uninitialized arguments. - However, gcc C++11 threads supports expects C++-compatible behavior, that is, two uninitialized pthread_t should compare equal. Avoids some runtime asserts in latest WebKit version. --- src/system/libroot/posix/pthread/pthread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system/libroot/posix/pthread/pthread.cpp b/src/system/libroot/posix/pthread/pthread.cpp index 6c441e1f21..ef708b9197 100644 --- a/src/system/libroot/posix/pthread/pthread.cpp +++ b/src/system/libroot/posix/pthread/pthread.cpp @@ -181,7 +181,7 @@ pthread_self(void) int pthread_equal(pthread_t t1, pthread_t t2) { - return t1 != NULL && t2 != NULL && t1 == t2; + return t1 == t2; }