From 336ebea6d24e8ddda8c33a91c8cd039a7ae8326f Mon Sep 17 00:00:00 2001
From: Michael Catanzaro <mcatanzaro@redhat.com>
Date: Mon, 1 Aug 2022 11:45:42 -0500
Subject: [PATCH] Revert changes to isMainThread
This introduced a regression:
https://bugs.webkit.org/show_bug.cgi?id=243401
---
Source/WTF/wtf/generic/MainThreadGeneric.cpp | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/Source/WTF/wtf/generic/MainThreadGeneric.cpp b/Source/WTF/wtf/generic/MainThreadGeneric.cpp
index 3a9208b0f9ab..b51e2e456047 100644
--- a/Source/WTF/wtf/generic/MainThreadGeneric.cpp
+++ b/Source/WTF/wtf/generic/MainThreadGeneric.cpp
@@ -31,29 +31,22 @@
*/
#include "config.h"
-#if !OS(LINUX)
#include <pthread.h>
-#endif
#if HAVE(PTHREAD_NP_H)
#include <pthread_np.h>
#endif
-#if OS(LINUX)
-#include <sys/syscall.h>
-#include <sys/types.h>
-#include <unistd.h>
-#endif
#include <wtf/RunLoop.h>
namespace WTF {
-#if !HAVE(PTHREAD_MAIN_NP) && !OS(LINUX)
+#if !HAVE(PTHREAD_MAIN_NP)
static pthread_t mainThread;
#endif
void initializeMainThreadPlatform()
{
-#if !HAVE(PTHREAD_MAIN_NP) && !OS(LINUX)
+#if !HAVE(PTHREAD_MAIN_NP)
mainThread = pthread_self();
#endif
}
@@ -62,8 +55,6 @@ bool isMainThread()
{
#if HAVE(PTHREAD_MAIN_NP)
return pthread_main_np();
-#elif OS(LINUX)
- return getpid() == static_cast<pid_t>(syscall(SYS_gettid));
#else
return pthread_equal(pthread_self(), mainThread);
#endif
--
2.36.1