do
{
- InitStatus = _InterlockedCompareExchange(&ThreadPoolInitialized,
+ InitStatus = InterlockedCompareExchange(&ThreadPoolInitialized,
2,
0);
if (InitStatus == 0)
Finish:
/* Initialization done */
- _InterlockedExchange(&ThreadPoolInitialized,
+ InterlockedExchange(&ThreadPoolInitialized,
1);
break;
}
}
/* update the requests counter */
- _InterlockedDecrement(&ThreadPoolWorkerThreadsRequests);
+ InterlockedDecrement(&ThreadPoolWorkerThreadsRequests);
if (WorkItem.Flags & WT_EXECUTELONGFUNCTION)
{
- _InterlockedDecrement(&ThreadPoolWorkerThreadsLongRequests);
+ InterlockedDecrement(&ThreadPoolWorkerThreadsLongRequests);
}
}
{
NTSTATUS Status = STATUS_SUCCESS;
- _InterlockedIncrement(&ThreadPoolWorkerThreadsRequests);
+ InterlockedIncrement(&ThreadPoolWorkerThreadsRequests);
if (WorkItem->Flags & WT_EXECUTELONGFUNCTION)
{
- _InterlockedIncrement(&ThreadPoolWorkerThreadsLongRequests);
+ InterlockedIncrement(&ThreadPoolWorkerThreadsLongRequests);
}
if (WorkItem->Flags & WT_EXECUTEINPERSISTENTTHREAD)
if (!NT_SUCCESS(Status))
{
- _InterlockedDecrement(&ThreadPoolWorkerThreadsRequests);
+ InterlockedDecrement(&ThreadPoolWorkerThreadsRequests);
if (WorkItem->Flags & WT_EXECUTELONGFUNCTION)
{
- _InterlockedDecrement(&ThreadPoolWorkerThreadsLongRequests);
+ InterlockedDecrement(&ThreadPoolWorkerThreadsLongRequests);
}
}
}
/* update the requests counter */
- _InterlockedDecrement(&ThreadPoolIOWorkerThreadsRequests);
+ InterlockedDecrement(&ThreadPoolIOWorkerThreadsRequests);
if (WorkItem.Flags & WT_EXECUTELONGFUNCTION)
{
- _InterlockedDecrement(&ThreadPoolIOWorkerThreadsLongRequests);
+ InterlockedDecrement(&ThreadPoolIOWorkerThreadsLongRequests);
}
}
ASSERT(IoThread != NULL);
- _InterlockedIncrement(&ThreadPoolIOWorkerThreadsRequests);
+ InterlockedIncrement(&ThreadPoolIOWorkerThreadsRequests);
if (WorkItem->Flags & WT_EXECUTELONGFUNCTION)
{
/* We're about to queue a long function, mark the thread */
IoThread->Flags |= WT_EXECUTELONGFUNCTION;
- _InterlockedIncrement(&ThreadPoolIOWorkerThreadsLongRequests);
+ InterlockedIncrement(&ThreadPoolIOWorkerThreadsLongRequests);
}
/* It's time to queue the work item */
if (!NT_SUCCESS(Status))
{
DPRINT1("Failed to queue APC for work item 0x%p\n", WorkItem->Function);
- _InterlockedDecrement(&ThreadPoolIOWorkerThreadsRequests);
+ InterlockedDecrement(&ThreadPoolIOWorkerThreadsRequests);
if (WorkItem->Flags & WT_EXECUTELONGFUNCTION)
{
- _InterlockedDecrement(&ThreadPoolIOWorkerThreadsLongRequests);
+ InterlockedDecrement(&ThreadPoolIOWorkerThreadsLongRequests);
}
}
BOOLEAN Terminate;
NTSTATUS Status = STATUS_SUCCESS;
- if (_InterlockedIncrement(&ThreadPoolIOWorkerThreads) > MAX_WORKERTHREADS)
+ if (InterlockedIncrement(&ThreadPoolIOWorkerThreads) > MAX_WORKERTHREADS)
{
/* Oops, too many worker threads... */
goto InitFailed;
DPRINT1("Failed to create handle to own thread! Status: 0x%x\n", Status);
InitFailed:
- _InterlockedDecrement(&ThreadPoolIOWorkerThreads);
+ InterlockedDecrement(&ThreadPoolIOWorkerThreads);
/* Signal initialization completion */
- _InterlockedExchange((PLONG)Parameter,
+ InterlockedExchange((PLONG)Parameter,
1);
RtlExitUserThread(Status);
(PLIST_ENTRY)&ThreadInfo.ListEntry);
/* Signal initialization completion */
- _InterlockedExchange((PLONG)Parameter,
+ InterlockedExchange((PLONG)Parameter,
1);
for (;;)
if (Terminate)
{
/* Rundown the thread and unlink it from the list */
- _InterlockedDecrement(&ThreadPoolIOWorkerThreads);
+ InterlockedDecrement(&ThreadPoolIOWorkerThreads);
RemoveEntryList((PLIST_ENTRY)&ThreadInfo.ListEntry);
}
PKNORMAL_ROUTINE ApcRoutine;
NTSTATUS Status = STATUS_SUCCESS;
- if (_InterlockedIncrement(&ThreadPoolWorkerThreads) > MAX_WORKERTHREADS)
+ if (InterlockedIncrement(&ThreadPoolWorkerThreads) > MAX_WORKERTHREADS)
{
/* Signal initialization completion */
- _InterlockedExchange((PLONG)Parameter,
+ InterlockedExchange((PLONG)Parameter,
1);
/* Oops, too many worker threads... */
}
/* Signal initialization completion */
- _InterlockedExchange((PLONG)Parameter,
+ InterlockedExchange((PLONG)Parameter,
1);
for (;;)
if (Terminate)
{
- _InterlockedDecrement(&ThreadPoolWorkerThreads);
+ InterlockedDecrement(&ThreadPoolWorkerThreads);
Status = STATUS_SUCCESS;
break;
}