blob: 5552940efd9e857ae7891f47a87cf4e5b148a7d3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
--- base/threading/platform_thread_posix.cc.orig 2023-09-17 07:59:53 UTC
+++ base/threading/platform_thread_posix.cc
@@ -76,12 +76,12 @@ void* ThreadFunc(void* params) {
if (!thread_params->joinable)
base::DisallowSingleton();
-#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && BUILDFLAG(USE_STARSCAN)
+#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) && BUILDFLAG(USE_STARSCAN) && !BUILDFLAG(IS_BSD)
partition_alloc::internal::PCScan::NotifyThreadCreated(
partition_alloc::internal::GetStackPointer());
#endif
-#if !BUILDFLAG(IS_NACL)
+#if !BUILDFLAG(IS_NACL) && !BUILDFLAG(IS_BSD)
#if BUILDFLAG(IS_APPLE)
PlatformThread::SetCurrentThreadRealtimePeriodValue(
delegate->GetRealtimePeriod());
@@ -353,7 +353,7 @@ 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 (from >= to) {
@@ -374,6 +374,9 @@ 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 (internal::SetCurrentThreadTypeForPlatform(thread_type, pump_type_hint))
return;
@@ -396,7 +399,7 @@ void SetCurrentThreadTypeImpl(ThreadType thread_type,
// static
ThreadPriorityForTest PlatformThreadBase::GetCurrentThreadPriorityForTest() {
-#if BUILDFLAG(IS_NACL)
+#if BUILDFLAG(IS_NACL) || BUILDFLAG(IS_BSD)
NOTIMPLEMENTED();
return ThreadPriorityForTest::kNormal;
#else
|