From f4cb879b3d6963b70e46976bae1be42b1143e9da Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Fri, 5 Mar 2021 21:24:30 -0600 Subject: [PATCH] ntdll-NtAlertThreadByThreadId: Include mach/mach.h in unix_private.h. Thanks to Dean Greer for finding this one. --- ...thread-id-alerts-on-top-of-Mach-sema.patch | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/patches/ntdll-NtAlertThreadByThreadId/0007-ntdll-Implement-thread-id-alerts-on-top-of-Mach-sema.patch b/patches/ntdll-NtAlertThreadByThreadId/0007-ntdll-Implement-thread-id-alerts-on-top-of-Mach-sema.patch index 67a71e9a..0f492083 100644 --- a/patches/ntdll-NtAlertThreadByThreadId/0007-ntdll-Implement-thread-id-alerts-on-top-of-Mach-sema.patch +++ b/patches/ntdll-NtAlertThreadByThreadId/0007-ntdll-Implement-thread-id-alerts-on-top-of-Mach-sema.patch @@ -1,4 +1,4 @@ -From ad509d2c9f4d49b87221929f65e4e35568ad33c2 Mon Sep 17 00:00:00 2001 +From 002d5f21931d383a28be7aefdcb0a5299e51afb8 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 31 Aug 2020 23:03:34 -0500 Subject: [PATCH] ntdll: Implement thread-id alerts on top of Mach semaphores @@ -8,14 +8,14 @@ Signed-off-by: Zebediah Figura --- dlls/ntdll/unix/sync.c | 44 ++++++++++++++++++++++++++++++++++ dlls/ntdll/unix/thread.c | 4 ++++ - dlls/ntdll/unix/unix_private.h | 8 +++++++ - 3 files changed, 56 insertions(+) + dlls/ntdll/unix/unix_private.h | 9 +++++++ + 3 files changed, 57 insertions(+) diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c -index 0c7fea3bd4d..0fee8f3099d 100644 +index f4f87ba5642..7d6423083e1 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c -@@ -2357,6 +2357,10 @@ NTSTATUS WINAPI NtAlertThreadByThreadId( HANDLE tid ) +@@ -2301,6 +2301,10 @@ NTSTATUS WINAPI NtAlertThreadByThreadId( HANDLE tid ) if (teb->ClientId.UniqueThread == tid) { pthread_rwlock_unlock( &teb_list_lock ); @@ -26,7 +26,7 @@ index 0c7fea3bd4d..0fee8f3099d 100644 #ifdef __linux__ if (use_futexes()) { -@@ -2368,6 +2372,7 @@ NTSTATUS WINAPI NtAlertThreadByThreadId( HANDLE tid ) +@@ -2312,6 +2316,7 @@ NTSTATUS WINAPI NtAlertThreadByThreadId( HANDLE tid ) #endif NtSetEvent( thread_data->tid_alert_event, NULL ); return STATUS_SUCCESS; @@ -34,7 +34,7 @@ index 0c7fea3bd4d..0fee8f3099d 100644 } } -@@ -2405,6 +2410,44 @@ NTSTATUS WINAPI NtWaitForAlertByThreadId( const void *address, const LARGE_INTEG +@@ -2349,6 +2354,44 @@ NTSTATUS WINAPI NtWaitForAlertByThreadId( const void *address, const LARGE_INTEG { TRACE( "%p %s\n", address, debugstr_timeout( timeout ) ); @@ -79,7 +79,7 @@ index 0c7fea3bd4d..0fee8f3099d 100644 #ifdef __linux__ if (use_futexes()) { -@@ -2440,6 +2483,7 @@ NTSTATUS WINAPI NtWaitForAlertByThreadId( const void *address, const LARGE_INTEG +@@ -2384,6 +2427,7 @@ NTSTATUS WINAPI NtWaitForAlertByThreadId( const void *address, const LARGE_INTEG } #endif return NtWaitForSingleObject( ntdll_get_thread_data()->tid_alert_event, FALSE, timeout ); @@ -88,7 +88,7 @@ index 0c7fea3bd4d..0fee8f3099d 100644 diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c -index bb55b3d29ed..05157e24ace 100644 +index 87f5a97131e..e97a9657f03 100644 --- a/dlls/ntdll/unix/thread.c +++ b/dlls/ntdll/unix/thread.c @@ -252,7 +252,11 @@ NTSTATUS WINAPI NtCreateThreadEx( HANDLE *handle, ACCESS_MASK access, OBJECT_ATT @@ -104,21 +104,22 @@ index bb55b3d29ed..05157e24ace 100644 pthread_attr_init( &pthread_attr ); pthread_attr_setstack( &pthread_attr, teb->DeallocationStack, diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h -index 429b1e767ff..0b5cf8a3c4f 100644 +index f7aec55e355..4b4b90f4944 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h -@@ -27,6 +27,10 @@ +@@ -27,6 +27,11 @@ #include "wine/server.h" #include "wine/list.h" +#ifdef __APPLE__ ++# include +# include +#endif + #ifdef __i386__ static const enum cpu_type client_cpu = CPU_x86; #elif defined(__x86_64__) -@@ -60,10 +64,14 @@ struct ntdll_thread_data +@@ -58,10 +63,14 @@ struct ntdll_thread_data struct list entry; /* entry in TEB list */ PRTL_THREAD_START_ROUTINE start; /* thread entry point */ void *param; /* thread entry point parameter */ @@ -134,5 +135,5 @@ index 429b1e767ff..0b5cf8a3c4f 100644 C_ASSERT( sizeof(struct ntdll_thread_data) <= sizeof(((TEB *)0)->GdiTebBatch) ); -- -2.30.0 +2.20.1