mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[channels,serial] explicitly lock serial->IrpThreads
This commit is contained in:
@@ -626,7 +626,10 @@ static void create_irp_thread(SERIAL_DEVICE* serial, IRP* irp)
|
||||
* observed with FreeRDP).
|
||||
*/
|
||||
key = irp->CompletionId + 1ull;
|
||||
|
||||
ListDictionary_Lock(serial->IrpThreads);
|
||||
previousIrpThread = ListDictionary_GetItemValue(serial->IrpThreads, (void*)key);
|
||||
ListDictionary_Unlock(serial->IrpThreads);
|
||||
|
||||
if (previousIrpThread)
|
||||
{
|
||||
@@ -742,7 +745,10 @@ static DWORD WINAPI serial_thread_func(LPVOID arg)
|
||||
create_irp_thread(serial, irp);
|
||||
}
|
||||
|
||||
ListDictionary_Lock(serial->IrpThreads);
|
||||
ListDictionary_Clear(serial->IrpThreads);
|
||||
ListDictionary_Unlock(serial->IrpThreads);
|
||||
|
||||
if (error && serial->rdpcontext)
|
||||
setChannelError(serial->rdpcontext, error, "serial_thread_func reported an error");
|
||||
|
||||
@@ -971,7 +977,7 @@ FREERDP_ENTRY_POINT(
|
||||
}
|
||||
|
||||
/* IrpThreads content only modified by create_irp_thread() */
|
||||
serial->IrpThreads = ListDictionary_New(TRUE);
|
||||
serial->IrpThreads = ListDictionary_New(FALSE);
|
||||
|
||||
if (!serial->IrpThreads)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user