Rebase against a55a37d1dae2231d8dec9f3191449f89be0b10dc.

This commit is contained in:
Alistair Leslie-Hughes
2021-02-17 09:56:43 +11:00
parent 4046ffe6c9
commit d0873d2c72
6 changed files with 50 additions and 50 deletions

View File

@@ -1,4 +1,4 @@
From 4c58c278a16e77650b1a3626df6e43cb603089e2 Mon Sep 17 00:00:00 2001
From ad509d2c9f4d49b87221929f65e4e35568ad33c2 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <z.figura12@gmail.com>
Date: Mon, 31 Aug 2020 23:03:34 -0500
Subject: [PATCH] ntdll: Implement thread-id alerts on top of Mach semaphores
@@ -12,10 +12,10 @@ Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
3 files changed, 56 insertions(+)
diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c
index 05a478ae464..377a34c0824 100644
index 0c7fea3bd4d..0fee8f3099d 100644
--- a/dlls/ntdll/unix/sync.c
+++ b/dlls/ntdll/unix/sync.c
@@ -2144,6 +2144,10 @@ NTSTATUS WINAPI NtAlertThreadByThreadId( HANDLE tid )
@@ -2357,6 +2357,10 @@ NTSTATUS WINAPI NtAlertThreadByThreadId( HANDLE tid )
if (teb->ClientId.UniqueThread == tid)
{
pthread_rwlock_unlock( &teb_list_lock );
@@ -26,7 +26,7 @@ index 05a478ae464..377a34c0824 100644
#ifdef __linux__
if (use_futexes())
{
@@ -2155,6 +2159,7 @@ NTSTATUS WINAPI NtAlertThreadByThreadId( HANDLE tid )
@@ -2368,6 +2372,7 @@ NTSTATUS WINAPI NtAlertThreadByThreadId( HANDLE tid )
#endif
NtSetEvent( thread_data->tid_alert_event, NULL );
return STATUS_SUCCESS;
@@ -34,7 +34,7 @@ index 05a478ae464..377a34c0824 100644
}
}
@@ -2192,6 +2197,44 @@ NTSTATUS WINAPI NtWaitForAlertByThreadId( const void *address, const LARGE_INTEG
@@ -2405,6 +2410,44 @@ NTSTATUS WINAPI NtWaitForAlertByThreadId( const void *address, const LARGE_INTEG
{
TRACE( "%p %s\n", address, debugstr_timeout( timeout ) );
@@ -79,7 +79,7 @@ index 05a478ae464..377a34c0824 100644
#ifdef __linux__
if (use_futexes())
{
@@ -2227,6 +2270,7 @@ NTSTATUS WINAPI NtWaitForAlertByThreadId( const void *address, const LARGE_INTEG
@@ -2440,6 +2483,7 @@ NTSTATUS WINAPI NtWaitForAlertByThreadId( const void *address, const LARGE_INTEG
}
#endif
return NtWaitForSingleObject( ntdll_get_thread_data()->tid_alert_event, FALSE, timeout );
@@ -104,11 +104,11 @@ 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 7e733052c87..dc1c379c790 100644
index 429b1e767ff..0b5cf8a3c4f 100644
--- a/dlls/ntdll/unix/unix_private.h
+++ b/dlls/ntdll/unix/unix_private.h
@@ -26,6 +26,10 @@
#include "unixlib.h"
@@ -27,6 +27,10 @@
#include "wine/server.h"
#include "wine/list.h"
+#ifdef __APPLE__
@@ -118,7 +118,7 @@ index 7e733052c87..dc1c379c790 100644
#ifdef __i386__
static const enum cpu_type client_cpu = CPU_x86;
#elif defined(__x86_64__)
@@ -57,10 +61,14 @@ struct ntdll_thread_data
@@ -60,10 +64,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 +134,5 @@ index 7e733052c87..dc1c379c790 100644
C_ASSERT( sizeof(struct ntdll_thread_data) <= sizeof(((TEB *)0)->GdiTebBatch) );
--
2.29.2
2.30.0