Differential D38165 Diff 118368 www/qt5-webengine/files/patch-src_3rdparty_chromium_base_threading_platform__thread__posix.cc
Changeset View
Changeset View
Standalone View
Standalone View
www/qt5-webengine/files/patch-src_3rdparty_chromium_base_threading_platform__thread__posix.cc
--- src/3rdparty/chromium/base/threading/platform_thread_posix.cc.orig 2018-11-13 18:25:11 UTC | --- src/3rdparty/chromium/base/threading/platform_thread_posix.cc.orig 2021-12-15 16:12:54 UTC | ||||
+++ src/3rdparty/chromium/base/threading/platform_thread_posix.cc | +++ src/3rdparty/chromium/base/threading/platform_thread_posix.cc | ||||
@@ -61,7 +61,7 @@ void* ThreadFunc(void* params) { | @@ -32,6 +32,10 @@ | ||||
if (!thread_params->joinable) | #include <sys/syscall.h> | ||||
base::ThreadRestrictions::SetSingletonAllowed(false); | #endif | ||||
-#if !defined(OS_NACL) | +#if defined(OS_BSD) | ||||
+#if !defined(OS_NACL) && !defined(OS_BSD) | +#include <pthread_np.h> | ||||
// Threads on linux/android may inherit their priority from the thread | +#endif | ||||
// where they were created. This explicitly sets the priority of all new | + | ||||
// threads. | #if defined(OS_FUCHSIA) | ||||
#include <zircon/process.h> | |||||
#else | |||||
@@ -141,7 +145,7 @@ bool CreateThread(size_t stack_size, | |||||
return success; | |||||
} | |||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) | |||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) | |||||
// Store the thread ids in local storage since calling the SWI can | |||||
// expensive and PlatformThread::CurrentId is used liberally. Clear | |||||
@@ -159,11 +163,11 @@ class InitAtFork { | |||||
InitAtFork() { pthread_atfork(nullptr, nullptr, internal::ClearTidCache); } | |||||
}; | |||||
-#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) | |||||
+#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSSD) | |||||
} // namespace | |||||
-#if defined(OS_LINUX) || defined(OS_CHROMEOS) | |||||
+#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) | |||||
namespace internal { | |||||
@@ -173,7 +177,7 @@ void ClearTidCache() { | |||||
} // namespace internal | |||||
-#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) | |||||
+#endif // defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_BSD) | |||||
// static | |||||
PlatformThreadId PlatformThread::CurrentId() { | |||||
@@ -181,6 +185,8 @@ PlatformThreadId PlatformThread::CurrentId() { | |||||
// into the kernel. | |||||
#if defined(OS_APPLE) | |||||
return pthread_mach_thread_np(pthread_self()); | |||||
+#elif defined(OS_BSD) | |||||
+ return pthread_getthreadid_np(); | |||||
#elif defined(OS_LINUX) || defined(OS_CHROMEOS) | |||||
static NoDestructor<InitAtFork> init_at_fork; | |||||
if (g_thread_id == -1) { |