mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 00:14:11 +09:00
[server,proxy] use default threadpool
Do not create a threadpool per smartcard channel instance. This is overkill and does not really improve performance, just wastes resources.
This commit is contained in:
@@ -44,8 +44,6 @@ typedef struct
|
||||
{
|
||||
InterceptContextMapEntry base;
|
||||
scard_call_context* callctx;
|
||||
PTP_POOL ThreadPool;
|
||||
TP_CALLBACK_ENVIRON ThreadPoolEnv;
|
||||
wArrayList* workObjects;
|
||||
} pf_channel_client_context;
|
||||
|
||||
@@ -145,7 +143,7 @@ static BOOL start_irp_thread(pf_channel_client_context* scard,
|
||||
if (!arg->e)
|
||||
goto fail;
|
||||
|
||||
work = CreateThreadpoolWork(irp_thread, arg, &scard->ThreadPoolEnv);
|
||||
work = CreateThreadpoolWork(irp_thread, arg, NULL);
|
||||
if (!work)
|
||||
goto fail;
|
||||
ArrayList_Append(scard->workObjects, work);
|
||||
@@ -291,8 +289,6 @@ static void pf_channel_scard_client_context_free(InterceptContextMapEntry* base)
|
||||
* available polling slot */
|
||||
channel_stop_and_wait(entry, FALSE);
|
||||
ArrayList_Free(entry->workObjects);
|
||||
CloseThreadpool(entry->ThreadPool);
|
||||
DestroyThreadpoolEnvironment(&entry->ThreadPoolEnv);
|
||||
|
||||
smartcard_call_context_free(entry->callctx);
|
||||
free(entry);
|
||||
@@ -358,12 +354,6 @@ BOOL pf_channel_smartcard_client_new(pClientContext* pc)
|
||||
WINPR_ASSERT(obj);
|
||||
obj->fnObjectFree = work_object_free;
|
||||
|
||||
scard->ThreadPool = CreateThreadpool(NULL);
|
||||
if (!scard->ThreadPool)
|
||||
goto fail;
|
||||
InitializeThreadpoolEnvironment(&scard->ThreadPoolEnv);
|
||||
SetThreadpoolCallbackPool(&scard->ThreadPoolEnv, scard->ThreadPool);
|
||||
|
||||
return HashTable_Insert(pc->interceptContextMap, SCARD_SVC_CHANNEL_NAME, scard);
|
||||
fail:
|
||||
pf_channel_scard_client_context_free(&scard->base);
|
||||
|
||||
Reference in New Issue
Block a user