1 of 4 commit (sorry my svn clinet is crazy for moment)

Commit w3seek patch from bug 1609 : file attachment (id=910) 
The attached patch implements QueueUserWorkItem()/RtlQueueWorkItem() (lacks
optimizations!!!). WINE's latest rpcrt4 relies on it.

1. Implement QueueUserWorkItem()/RtlQueueWorkItem() :
2. A slightly optimized 
3. Supports WT_TRANSFER_IMPERSONATION
4. Slightly improved handling of growing/shrinking the pool by assuming work items with WT_EXECUTELONGFUNCTION run longer
5. Fixes a hack that made a worker thread always terminate if there were at least one more thread available




svn path=/trunk/; revision=22804
This commit is contained in:
Magnus Olsen 2006-07-03 20:23:10 +00:00
parent abedc7b76b
commit d2bab053ae

View file

@ -93,7 +93,7 @@ static const struct
{TRUE, 0}, // ThreadIdealProcessor {TRUE, 0}, // ThreadIdealProcessor
{FALSE, 0}, // ThreadPriorityBoost {FALSE, 0}, // ThreadPriorityBoost
{TRUE, 0}, // ThreadSetTlsArrayAddress {TRUE, 0}, // ThreadSetTlsArrayAddress
{FALSE, 0}, // ThreadIsIoPending {TRUE, sizeof(ULONG)}, // ThreadIsIoPending
{TRUE, 0} // ThreadHideFromDebugger {TRUE, 0} // ThreadHideFromDebugger
}; };
@ -1191,6 +1191,7 @@ NtQueryInformationThread (IN HANDLE ThreadHandle,
PVOID Address; PVOID Address;
LARGE_INTEGER Count; LARGE_INTEGER Count;
BOOLEAN Last; BOOLEAN Last;
ULONG IsIoPending;
}u; }u;
KPROCESSOR_MODE PreviousMode; KPROCESSOR_MODE PreviousMode;
NTSTATUS Status = STATUS_SUCCESS; NTSTATUS Status = STATUS_SUCCESS;
@ -1292,6 +1293,18 @@ NtQueryInformationThread (IN HANDLE ThreadHandle,
u.Last = FALSE; u.Last = FALSE;
} }
break; break;
case ThreadIsIoPending:
{
KIRQL OldIrql;
/* Raise the IRQL to protect the IRP list */
KeRaiseIrql(APC_LEVEL, &OldIrql);
u.IsIoPending = !IsListEmpty(&Thread->IrpList);
KeLowerIrql(OldIrql);
break;
}
default: default:
/* Shoult never occure if the data table is correct */ /* Shoult never occure if the data table is correct */
KEBUGCHECK(0); KEBUGCHECK(0);