rpcrt4: Hold the thread-data's critical section while cancelling a call.

Check that there is a connection before trying to cancel it.
This commit is contained in:
Rob Shearman 2007-11-18 15:51:03 +00:00 committed by Alexandre Julliard
parent 23e995e3a7
commit 8a15423ab7
1 changed files with 3 additions and 1 deletions

View File

@ -926,7 +926,9 @@ RPC_STATUS RPC_ENTRY RpcCancelThread(void* ThreadHandle)
LIST_FOR_EACH_ENTRY(tdata, &threaddata_list, struct threaddata, entry)
if (tdata->thread_id == target_tid)
{
rpcrt4_conn_cancel_call(tdata->connection);
EnterCriticalSection(&tdata->cs);
if (tdata->connection) rpcrt4_conn_cancel_call(tdata->connection);
LeaveCriticalSection(&tdata->cs);
break;
}
LeaveCriticalSection(&threaddata_cs);