aboutsummaryrefslogtreecommitdiff
path: root/www/ungoogled-chromium/files/patch-base_threading_platform__thread__posix.cc
diff options
context:
space:
mode:
Diffstat (limited to 'www/ungoogled-chromium/files/patch-base_threading_platform__thread__posix.cc')
-rw-r--r--www/ungoogled-chromium/files/patch-base_threading_platform__thread__posix.cc87
1 files changed, 58 insertions, 29 deletions
diff --git a/www/ungoogled-chromium/files/patch-base_threading_platform__thread__posix.cc b/www/ungoogled-chromium/files/patch-base_threading_platform__thread__posix.cc
index 3af970da5906..2b6a7aaaafd4 100644
--- a/www/ungoogled-chromium/files/patch-base_threading_platform__thread__posix.cc
+++ b/www/ungoogled-chromium/files/patch-base_threading_platform__thread__posix.cc
@@ -1,21 +1,23 @@
---- base/threading/platform_thread_posix.cc.orig 2025-04-15 08:30:07 UTC
+--- base/threading/platform_thread_posix.cc.orig 2025-09-10 13:22:16 UTC
+++ base/threading/platform_thread_posix.cc
-@@ -79,11 +79,11 @@ void* ThreadFunc(void* params) {
+@@ -79,6 +79,7 @@ void* ThreadFunc(void* params) {
base::DisallowSingleton();
}
--#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
-+#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && !BUILDFLAG(IS_BSD)
++#if !BUILDFLAG(IS_BSD)
+ #if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
partition_alloc::internal::StackTopRegistry::Get().NotifyThreadCreated();
#endif
+@@ -92,6 +93,7 @@ void* ThreadFunc(void* params) {
+ // where they were created. This explicitly sets the priority of all new
+ // threads.
+ PlatformThread::SetCurrentThreadType(thread_params->thread_type);
++#endif
+ }
+
+ ThreadIdNameManager::GetInstance()->RegisterThread(
+@@ -266,6 +268,8 @@ PlatformThreadId PlatformThreadBase::CurrentId() {
--#if !BUILDFLAG(IS_NACL)
-+#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD)
- #if BUILDFLAG(IS_APPLE)
- PlatformThread::SetCurrentThreadRealtimePeriodValue(
- delegate->GetRealtimePeriod());
-@@ -272,6 +272,8 @@ PlatformThreadId PlatformThreadBase::CurrentId() {
- return PlatformThreadId(reinterpret_cast<int32_t>(pthread_self()));
#elif BUILDFLAG(IS_POSIX) && BUILDFLAG(IS_AIX)
return PlatformThreadId(pthread_self());
+#elif BUILDFLAG(IS_BSD)
@@ -23,31 +25,58 @@
#elif BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_AIX)
return PlatformThreadId(reinterpret_cast<int64_t>(pthread_self()));
#endif
-@@ -365,7 +367,7 @@ void PlatformThreadBase::Detach(PlatformThreadHandle t
+@@ -359,6 +363,9 @@ void PlatformThreadBase::Detach(PlatformThreadHandle t
// static
bool PlatformThreadBase::CanChangeThreadType(ThreadType from, ThreadType to) {
--#if BUILDFLAG(IS_NACL)
-+#if BUILDFLAG(IS_NACL) || BUILDFLAG(IS_BSD)
- return false;
- #else
++#if BUILDFLAG(IS_BSD)
++ return false;
++#else
if (from >= to) {
-@@ -386,6 +388,9 @@ void SetCurrentThreadTypeImpl(ThreadType thread_type,
+ // Decreasing thread priority on POSIX is always allowed.
+ return true;
+@@ -368,12 +375,18 @@ bool PlatformThreadBase::CanChangeThreadType(ThreadTyp
+ }
+
+ return internal::CanLowerNiceTo(internal::ThreadTypeToNiceValue(to));
++#endif
+ }
+
+ namespace internal {
+
+ void SetCurrentThreadTypeImpl(ThreadType thread_type,
MessagePumpType pump_type_hint) {
- #if BUILDFLAG(IS_NACL)
- NOTIMPLEMENTED();
-+// avoid pledge(2) violation
-+#elif BUILDFLAG(IS_BSD)
-+ NOTIMPLEMENTED();
- #else
++#if BUILDFLAG(IS_BSD)
++ // pledge(2) violation
++ NOTIMPLEMENTED();
++ return;
++#else
if (internal::SetCurrentThreadTypeForPlatform(thread_type, pump_type_hint)) {
return;
-@@ -409,7 +414,7 @@ void SetCurrentThreadTypeImpl(ThreadType thread_type,
+ }
+@@ -389,12 +402,17 @@ void SetCurrentThreadTypeImpl(ThreadType thread_type,
+ DVPLOG(1) << "Failed to set nice value of thread ("
+ << PlatformThread::CurrentId() << ") to " << nice_setting;
+ }
++#endif
+ }
+
+ } // namespace internal
// static
ThreadPriorityForTest PlatformThreadBase::GetCurrentThreadPriorityForTest() {
--#if BUILDFLAG(IS_NACL)
-+#if BUILDFLAG(IS_NACL) || BUILDFLAG(IS_BSD)
- NOTIMPLEMENTED();
- return ThreadPriorityForTest::kNormal;
- #else
++#if BUILDFLAG(IS_BSD)
++ NOTIMPLEMENTED();
++ return ThreadPriorityForTest::kNormal;
++#else
+ // Mirrors SetCurrentThreadPriority()'s implementation.
+ auto platform_specific_priority =
+ internal::GetCurrentThreadPriorityForPlatformForTest(); // IN-TEST
+@@ -405,6 +423,7 @@ ThreadPriorityForTest PlatformThreadBase::GetCurrentTh
+ int nice_value = internal::GetCurrentThreadNiceValue();
+
+ return internal::NiceValueToThreadPriorityForTest(nice_value); // IN-TEST
++#endif
+ }
+
+ #endif // !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_FUCHSIA)