You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Rebase against 5dffe2263de41e76100ba0acd7c717267dc4c878.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
From af2439799ba730871f55e481523605a3dbc114e7 Mon Sep 17 00:00:00 2001
|
||||
From 217794090443a96e712ffe3970e4a70ded2277dc Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sat, 5 Aug 2017 03:39:37 +0200
|
||||
Subject: [PATCH] ntdll: Use fast CS functions for threadpool locking.
|
||||
@@ -8,10 +8,10 @@ Subject: [PATCH] ntdll: Use fast CS functions for threadpool locking.
|
||||
1 file changed, 45 insertions(+), 45 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/threadpool.c b/dlls/ntdll/threadpool.c
|
||||
index bdc1ebddd7d..b806963a1f8 100644
|
||||
index ca323919d05..581d503b6a4 100644
|
||||
--- a/dlls/ntdll/threadpool.c
|
||||
+++ b/dlls/ntdll/threadpool.c
|
||||
@@ -1052,7 +1052,7 @@ static void CALLBACK timerqueue_thread_proc( void *param )
|
||||
@@ -1053,7 +1053,7 @@ static void CALLBACK timerqueue_thread_proc( void *param )
|
||||
|
||||
TRACE( "starting timer queue thread\n" );
|
||||
|
||||
@@ -141,7 +141,7 @@ index bdc1ebddd7d..b806963a1f8 100644
|
||||
}
|
||||
|
||||
static void CALLBACK ioqueue_thread_proc( void *param )
|
||||
@@ -1753,7 +1753,7 @@ static NTSTATUS tp_threadpool_lock( struct threadpool **out, TP_CALLBACK_ENVIRON
|
||||
@@ -1775,7 +1775,7 @@ static NTSTATUS tp_threadpool_lock( struct threadpool **out, TP_CALLBACK_ENVIRON
|
||||
pool = default_threadpool;
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ index bdc1ebddd7d..b806963a1f8 100644
|
||||
|
||||
/* Make sure that the threadpool has at least one thread. */
|
||||
if (!pool->num_workers)
|
||||
@@ -1767,7 +1767,7 @@ static NTSTATUS tp_threadpool_lock( struct threadpool **out, TP_CALLBACK_ENVIRON
|
||||
@@ -1789,7 +1789,7 @@ static NTSTATUS tp_threadpool_lock( struct threadpool **out, TP_CALLBACK_ENVIRON
|
||||
pool->objcount++;
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ index bdc1ebddd7d..b806963a1f8 100644
|
||||
|
||||
if (status != STATUS_SUCCESS)
|
||||
return status;
|
||||
@@ -1783,9 +1783,9 @@ static NTSTATUS tp_threadpool_lock( struct threadpool **out, TP_CALLBACK_ENVIRON
|
||||
@@ -1805,9 +1805,9 @@ static NTSTATUS tp_threadpool_lock( struct threadpool **out, TP_CALLBACK_ENVIRON
|
||||
*/
|
||||
static void tp_threadpool_unlock( struct threadpool *pool )
|
||||
{
|
||||
@@ -171,7 +171,7 @@ index bdc1ebddd7d..b806963a1f8 100644
|
||||
tp_threadpool_release( pool );
|
||||
}
|
||||
|
||||
@@ -1923,10 +1923,10 @@ static void tp_object_initialize( struct threadpool_object *object, struct threa
|
||||
@@ -1945,10 +1945,10 @@ static void tp_object_initialize( struct threadpool_object *object, struct threa
|
||||
struct threadpool_group *group = object->group;
|
||||
InterlockedIncrement( &group->refcount );
|
||||
|
||||
@@ -184,7 +184,7 @@ index bdc1ebddd7d..b806963a1f8 100644
|
||||
}
|
||||
|
||||
if (is_simple_callback)
|
||||
@@ -1953,7 +1953,7 @@ static void tp_object_submit( struct threadpool_object *object, BOOL signaled )
|
||||
@@ -1975,7 +1975,7 @@ static void tp_object_submit( struct threadpool_object *object, BOOL signaled )
|
||||
assert( !object->shutdown );
|
||||
assert( !pool->shutdown );
|
||||
|
||||
@@ -193,7 +193,7 @@ index bdc1ebddd7d..b806963a1f8 100644
|
||||
|
||||
/* Start new worker threads if required. */
|
||||
if (pool->num_busy_workers >= pool->num_workers &&
|
||||
@@ -1976,7 +1976,7 @@ static void tp_object_submit( struct threadpool_object *object, BOOL signaled )
|
||||
@@ -1998,7 +1998,7 @@ static void tp_object_submit( struct threadpool_object *object, BOOL signaled )
|
||||
RtlWakeConditionVariable( &pool->update_event );
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ index bdc1ebddd7d..b806963a1f8 100644
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
@@ -1989,7 +1989,7 @@ static void tp_object_cancel( struct threadpool_object *object )
|
||||
@@ -2011,7 +2011,7 @@ static void tp_object_cancel( struct threadpool_object *object )
|
||||
struct threadpool *pool = object->pool;
|
||||
LONG pending_callbacks = 0;
|
||||
|
||||
@@ -211,16 +211,16 @@ index bdc1ebddd7d..b806963a1f8 100644
|
||||
if (object->num_pending_callbacks)
|
||||
{
|
||||
pending_callbacks = object->num_pending_callbacks;
|
||||
@@ -2001,7 +2001,7 @@ static void tp_object_cancel( struct threadpool_object *object )
|
||||
}
|
||||
if (object->type == TP_OBJECT_TYPE_IO)
|
||||
@@ -2026,7 +2026,7 @@ static void tp_object_cancel( struct threadpool_object *object )
|
||||
object->u.io.skipped_count += object->u.io.pending_count;
|
||||
object->u.io.pending_count = 0;
|
||||
}
|
||||
- RtlLeaveCriticalSection( &pool->cs );
|
||||
+ leave_critical_section( &pool->cs );
|
||||
|
||||
while (pending_callbacks--)
|
||||
tp_object_release( object );
|
||||
@@ -2030,7 +2030,7 @@ static void tp_object_wait( struct threadpool_object *object, BOOL group_wait )
|
||||
@@ -2055,7 +2055,7 @@ static void tp_object_wait( struct threadpool_object *object, BOOL group_wait )
|
||||
{
|
||||
struct threadpool *pool = object->pool;
|
||||
|
||||
@@ -229,7 +229,7 @@ index bdc1ebddd7d..b806963a1f8 100644
|
||||
while (!object_is_finished( object, group_wait ))
|
||||
{
|
||||
if (group_wait)
|
||||
@@ -2038,7 +2038,7 @@ static void tp_object_wait( struct threadpool_object *object, BOOL group_wait )
|
||||
@@ -2063,7 +2063,7 @@ static void tp_object_wait( struct threadpool_object *object, BOOL group_wait )
|
||||
else
|
||||
RtlSleepConditionVariableCS( &object->finished_event, &pool->cs, NULL );
|
||||
}
|
||||
@@ -237,8 +237,8 @@ index bdc1ebddd7d..b806963a1f8 100644
|
||||
+ leave_critical_section( &pool->cs );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
@@ -2078,13 +2078,13 @@ static BOOL tp_object_release( struct threadpool_object *object )
|
||||
static void tp_ioqueue_unlock( struct threadpool_object *io )
|
||||
@@ -2117,13 +2117,13 @@ static BOOL tp_object_release( struct threadpool_object *object )
|
||||
{
|
||||
struct threadpool_group *group = object->group;
|
||||
|
||||
@@ -254,7 +254,7 @@ index bdc1ebddd7d..b806963a1f8 100644
|
||||
|
||||
tp_group_release( group );
|
||||
}
|
||||
@@ -2286,7 +2286,7 @@ static void CALLBACK threadpool_worker_proc( void *param )
|
||||
@@ -2324,7 +2324,7 @@ static void CALLBACK threadpool_worker_proc( void *param )
|
||||
|
||||
TRACE( "starting worker thread for pool %p\n", pool );
|
||||
|
||||
@@ -263,7 +263,7 @@ index bdc1ebddd7d..b806963a1f8 100644
|
||||
for (;;)
|
||||
{
|
||||
while ((ptr = threadpool_get_next_item( pool )))
|
||||
@@ -2326,7 +2326,7 @@ static void CALLBACK threadpool_worker_proc( void *param )
|
||||
@@ -2364,7 +2364,7 @@ static void CALLBACK threadpool_worker_proc( void *param )
|
||||
}
|
||||
}
|
||||
pool->num_workers--;
|
||||
@@ -272,7 +272,7 @@ index bdc1ebddd7d..b806963a1f8 100644
|
||||
|
||||
TRACE( "terminating worker thread for pool %p\n", pool );
|
||||
tp_threadpool_release( pool );
|
||||
@@ -2572,7 +2572,7 @@ NTSTATUS WINAPI TpCallbackMayRunLong( TP_CALLBACK_INSTANCE *instance )
|
||||
@@ -2612,7 +2612,7 @@ NTSTATUS WINAPI TpCallbackMayRunLong( TP_CALLBACK_INSTANCE *instance )
|
||||
return STATUS_SUCCESS;
|
||||
|
||||
pool = object->pool;
|
||||
@@ -281,7 +281,7 @@ index bdc1ebddd7d..b806963a1f8 100644
|
||||
|
||||
/* Start new worker threads if required. */
|
||||
if (pool->num_busy_workers >= pool->num_workers)
|
||||
@@ -2587,7 +2587,7 @@ NTSTATUS WINAPI TpCallbackMayRunLong( TP_CALLBACK_INSTANCE *instance )
|
||||
@@ -2627,7 +2627,7 @@ NTSTATUS WINAPI TpCallbackMayRunLong( TP_CALLBACK_INSTANCE *instance )
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,7 +290,7 @@ index bdc1ebddd7d..b806963a1f8 100644
|
||||
this->may_run_long = TRUE;
|
||||
return status;
|
||||
}
|
||||
@@ -2668,13 +2668,13 @@ VOID WINAPI TpDisassociateCallback( TP_CALLBACK_INSTANCE *instance )
|
||||
@@ -2708,13 +2708,13 @@ VOID WINAPI TpDisassociateCallback( TP_CALLBACK_INSTANCE *instance )
|
||||
return;
|
||||
|
||||
pool = object->pool;
|
||||
@@ -306,7 +306,7 @@ index bdc1ebddd7d..b806963a1f8 100644
|
||||
this->associated = FALSE;
|
||||
}
|
||||
|
||||
@@ -2726,7 +2726,7 @@ VOID WINAPI TpReleaseCleanupGroupMembers( TP_CLEANUP_GROUP *group, BOOL cancel_p
|
||||
@@ -2766,7 +2766,7 @@ VOID WINAPI TpReleaseCleanupGroupMembers( TP_CLEANUP_GROUP *group, BOOL cancel_p
|
||||
|
||||
TRACE( "%p %u %p\n", group, cancel_pending, userdata );
|
||||
|
||||
@@ -315,7 +315,7 @@ index bdc1ebddd7d..b806963a1f8 100644
|
||||
|
||||
/* Unset group, increase references, and mark objects for shutdown */
|
||||
LIST_FOR_EACH_ENTRY_SAFE( object, next, &this->members, struct threadpool_object, group_entry )
|
||||
@@ -2752,7 +2752,7 @@ VOID WINAPI TpReleaseCleanupGroupMembers( TP_CLEANUP_GROUP *group, BOOL cancel_p
|
||||
@@ -2792,7 +2792,7 @@ VOID WINAPI TpReleaseCleanupGroupMembers( TP_CLEANUP_GROUP *group, BOOL cancel_p
|
||||
list_init( &members );
|
||||
list_move_tail( &members, &this->members );
|
||||
|
||||
@@ -324,7 +324,7 @@ index bdc1ebddd7d..b806963a1f8 100644
|
||||
|
||||
/* Cancel pending callbacks if requested */
|
||||
if (cancel_pending)
|
||||
@@ -2866,10 +2866,10 @@ VOID WINAPI TpSetPoolMaxThreads( TP_POOL *pool, DWORD maximum )
|
||||
@@ -2915,10 +2915,10 @@ VOID WINAPI TpSetPoolMaxThreads( TP_POOL *pool, DWORD maximum )
|
||||
|
||||
TRACE( "%p %u\n", pool, maximum );
|
||||
|
||||
@@ -337,7 +337,7 @@ index bdc1ebddd7d..b806963a1f8 100644
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
@@ -2882,7 +2882,7 @@ BOOL WINAPI TpSetPoolMinThreads( TP_POOL *pool, DWORD minimum )
|
||||
@@ -2931,7 +2931,7 @@ BOOL WINAPI TpSetPoolMinThreads( TP_POOL *pool, DWORD minimum )
|
||||
|
||||
TRACE( "%p %u\n", pool, minimum );
|
||||
|
||||
@@ -346,7 +346,7 @@ index bdc1ebddd7d..b806963a1f8 100644
|
||||
|
||||
while (this->num_workers < minimum)
|
||||
{
|
||||
@@ -2897,7 +2897,7 @@ BOOL WINAPI TpSetPoolMinThreads( TP_POOL *pool, DWORD minimum )
|
||||
@@ -2946,7 +2946,7 @@ BOOL WINAPI TpSetPoolMinThreads( TP_POOL *pool, DWORD minimum )
|
||||
this->max_workers = max( this->min_workers, this->max_workers );
|
||||
}
|
||||
|
||||
@@ -355,7 +355,7 @@ index bdc1ebddd7d..b806963a1f8 100644
|
||||
return !status;
|
||||
}
|
||||
|
||||
@@ -2913,7 +2913,7 @@ VOID WINAPI TpSetTimer( TP_TIMER *timer, LARGE_INTEGER *timeout, LONG period, LO
|
||||
@@ -2962,7 +2962,7 @@ VOID WINAPI TpSetTimer( TP_TIMER *timer, LARGE_INTEGER *timeout, LONG period, LO
|
||||
|
||||
TRACE( "%p %p %u %u\n", timer, timeout, period, window_length );
|
||||
|
||||
@@ -364,7 +364,7 @@ index bdc1ebddd7d..b806963a1f8 100644
|
||||
|
||||
assert( this->u.timer.timer_initialized );
|
||||
this->u.timer.timer_set = timeout != NULL;
|
||||
@@ -2973,7 +2973,7 @@ VOID WINAPI TpSetTimer( TP_TIMER *timer, LARGE_INTEGER *timeout, LONG period, LO
|
||||
@@ -3022,7 +3022,7 @@ VOID WINAPI TpSetTimer( TP_TIMER *timer, LARGE_INTEGER *timeout, LONG period, LO
|
||||
this->u.timer.timer_pending = TRUE;
|
||||
}
|
||||
|
||||
@@ -373,7 +373,7 @@ index bdc1ebddd7d..b806963a1f8 100644
|
||||
|
||||
if (submit_timer)
|
||||
tp_object_submit( this, FALSE );
|
||||
@@ -2989,7 +2989,7 @@ VOID WINAPI TpSetWait( TP_WAIT *wait, HANDLE handle, LARGE_INTEGER *timeout )
|
||||
@@ -3038,7 +3038,7 @@ VOID WINAPI TpSetWait( TP_WAIT *wait, HANDLE handle, LARGE_INTEGER *timeout )
|
||||
|
||||
TRACE( "%p %p %p\n", wait, handle, timeout );
|
||||
|
||||
@@ -382,7 +382,7 @@ index bdc1ebddd7d..b806963a1f8 100644
|
||||
|
||||
assert( this->u.wait.bucket );
|
||||
this->u.wait.handle = handle;
|
||||
@@ -3028,7 +3028,7 @@ VOID WINAPI TpSetWait( TP_WAIT *wait, HANDLE handle, LARGE_INTEGER *timeout )
|
||||
@@ -3077,7 +3077,7 @@ VOID WINAPI TpSetWait( TP_WAIT *wait, HANDLE handle, LARGE_INTEGER *timeout )
|
||||
NtSetEvent( bucket->update_event, NULL );
|
||||
}
|
||||
|
||||
@@ -392,5 +392,5 @@ index bdc1ebddd7d..b806963a1f8 100644
|
||||
|
||||
/***********************************************************************
|
||||
--
|
||||
2.30.0
|
||||
2.30.2
|
||||
|
||||
|
Reference in New Issue
Block a user