Skip to content

Instantly share code, notes, and snippets.

@blah1
Created September 21, 2024 21:35
Show Gist options
  • Save blah1/4bac9acf25766ee222a284f465352390 to your computer and use it in GitHub Desktop.
Save blah1/4bac9acf25766ee222a284f465352390 to your computer and use it in GitHub Desktop.
Revert_a81dbfb.patch
diff --git a/dlls/ntdll/unix/thread.c b/dlls/ntdll/unix/thread.c
index c3ab1317295..e725955ebc4 100644
--- a/dlls/ntdll/unix/thread.c
+++ b/dlls/ntdll/unix/thread.c
@@ -1624,7 +1624,6 @@ NTSTATUS WINAPI NtOpenThread( HANDLE *handle, ACCESS_MASK access,
*/
NTSTATUS WINAPI NtSuspendThread( HANDLE handle, ULONG *ret_count )
{
- BOOL self = FALSE;
unsigned int ret, count = 0;
HANDLE wait_handle = NULL;
@@ -1633,15 +1632,12 @@ NTSTATUS WINAPI NtSuspendThread( HANDLE handle, ULONG *ret_count )
req->handle = wine_server_obj_handle( handle );
if (!(ret = wine_server_call( req )) || ret == STATUS_PENDING)
{
- self = reply->count & 0x80000000;
- count = reply->count & 0x7fffffff;;
+ count = reply->count;
wait_handle = wine_server_ptr_handle( reply->wait_handle );
}
}
SERVER_END_REQ;
- if (self) usleep( 0 );
-
if (ret == STATUS_PENDING && wait_handle)
{
NtWaitForSingleObject( wait_handle, FALSE, NULL );
diff --git a/server/thread.c b/server/thread.c
index 0620686399d..b39139469c1 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -912,11 +912,7 @@ int suspend_thread( struct thread *thread )
int old_count = thread->suspend;
if (thread->suspend < MAXIMUM_SUSPEND_COUNT)
{
- if (!(thread->process->suspend + thread->suspend++))
- {
- stop_thread( thread );
- if (thread == current) return old_count | 0x80000000;
- }
+ if (!(thread->process->suspend + thread->suspend++)) stop_thread( thread );
}
else set_error( STATUS_SUSPEND_COUNT_EXCEEDED );
return old_count;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment