Process Hacker
workqueue.c File Reference
#include <phbase.h>
#include <phintrnl.h>

Go to the source code of this file.

Macros

#define _PH_WORKQUEUE_PRIVATE
 

Functions

HANDLE PhpGetSemaphoreWorkQueue (_Inout_ PPH_WORK_QUEUE WorkQueue)
 
BOOLEAN PhpCreateWorkQueueThread (_Inout_ PPH_WORK_QUEUE WorkQueue)
 
NTSTATUS PhpWorkQueueThreadStart (_In_ PVOID Parameter)
 
VOID PhWorkQueueInitialization (VOID)
 
FORCEINLINE PPH_WORK_QUEUE_ITEM PhpCreateWorkQueueItem (_In_ PUSER_THREAD_START_ROUTINE Function, _In_opt_ PVOID Context, _In_opt_ PPH_WORK_QUEUE_ITEM_DELETE_FUNCTION DeleteFunction)
 
FORCEINLINE VOID PhpDestroyWorkQueueItem (_In_ PPH_WORK_QUEUE_ITEM WorkQueueItem)
 
FORCEINLINE VOID PhpExecuteWorkQueueItem (_Inout_ PPH_WORK_QUEUE_ITEM WorkQueueItem)
 
VOID PhInitializeWorkQueue (_Out_ PPH_WORK_QUEUE WorkQueue, _In_ ULONG MinimumThreads, _In_ ULONG MaximumThreads, _In_ ULONG NoWorkTimeout)
 Initializes a work queue.
 
VOID PhDeleteWorkQueue (_Inout_ PPH_WORK_QUEUE WorkQueue)
 Frees resources used by a work queue.
 
VOID PhWaitForWorkQueue (_Inout_ PPH_WORK_QUEUE WorkQueue)
 Waits for all queued work items to be executed.
 
VOID PhQueueItemWorkQueue (_Inout_ PPH_WORK_QUEUE WorkQueue, _In_ PUSER_THREAD_START_ROUTINE Function, _In_opt_ PVOID Context)
 Queues a work item to a work queue.
 
VOID PhQueueItemWorkQueueEx (_Inout_ PPH_WORK_QUEUE WorkQueue, _In_ PUSER_THREAD_START_ROUTINE Function, _In_opt_ PVOID Context, _In_opt_ PPH_WORK_QUEUE_ITEM_DELETE_FUNCTION DeleteFunction)
 Queues a work item to a work queue.
 
VOID PhQueueItemGlobalWorkQueue (_In_ PUSER_THREAD_START_ROUTINE Function, _In_opt_ PVOID Context)
 Queues a work item to the global work queue.
 

Macro Definition Documentation

#define _PH_WORKQUEUE_PRIVATE

Definition at line 23 of file workqueue.c.

Function Documentation

VOID PhDeleteWorkQueue ( _Inout_ PPH_WORK_QUEUE  WorkQueue)

Frees resources used by a work queue.

Parameters
WorkQueueA work queue object.

Definition at line 137 of file workqueue.c.

VOID PhInitializeWorkQueue ( _Out_ PPH_WORK_QUEUE  WorkQueue,
_In_ ULONG  MinimumThreads,
_In_ ULONG  MaximumThreads,
_In_ ULONG  NoWorkTimeout 
)

Initializes a work queue.

Parameters
WorkQueueA work queue object.
MinimumThreadsThe suggested minimum number of threads to keep alive, even when there is no work to be performed.
MaximumThreadsThe suggested maximum number of threads to create.
NoWorkTimeoutThe number of milliseconds after which threads without work will terminate.

Definition at line 101 of file workqueue.c.

FORCEINLINE PPH_WORK_QUEUE_ITEM PhpCreateWorkQueueItem ( _In_ PUSER_THREAD_START_ROUTINE  Function,
_In_opt_ PVOID  Context,
_In_opt_ PPH_WORK_QUEUE_ITEM_DELETE_FUNCTION  DeleteFunction 
)

Definition at line 58 of file workqueue.c.

BOOLEAN PhpCreateWorkQueueThread ( _Inout_ PPH_WORK_QUEUE  WorkQueue)

Definition at line 224 of file workqueue.c.

FORCEINLINE VOID PhpDestroyWorkQueueItem ( _In_ PPH_WORK_QUEUE_ITEM  WorkQueueItem)

Definition at line 74 of file workqueue.c.

FORCEINLINE VOID PhpExecuteWorkQueueItem ( _Inout_ PPH_WORK_QUEUE_ITEM  WorkQueueItem)

Definition at line 84 of file workqueue.c.

HANDLE PhpGetSemaphoreWorkQueue ( _Inout_ PPH_WORK_QUEUE  WorkQueue)

Definition at line 196 of file workqueue.c.

NTSTATUS PhpWorkQueueThreadStart ( _In_ PVOID  Parameter)

Definition at line 252 of file workqueue.c.

VOID PhQueueItemGlobalWorkQueue ( _In_ PUSER_THREAD_START_ROUTINE  Function,
_In_opt_ PVOID  Context 
)

Queues a work item to the global work queue.

Parameters
FunctionA function to execute.
ContextA user-defined value to pass to the function.

Definition at line 421 of file workqueue.c.

VOID PhQueueItemWorkQueue ( _Inout_ PPH_WORK_QUEUE  WorkQueue,
_In_ PUSER_THREAD_START_ROUTINE  Function,
_In_opt_ PVOID  Context 
)

Queues a work item to a work queue.

Parameters
WorkQueueA work queue object.
FunctionA function to execute.
ContextA user-defined value to pass to the function.

Definition at line 363 of file workqueue.c.

VOID PhQueueItemWorkQueueEx ( _Inout_ PPH_WORK_QUEUE  WorkQueue,
_In_ PUSER_THREAD_START_ROUTINE  Function,
_In_opt_ PVOID  Context,
_In_opt_ PPH_WORK_QUEUE_ITEM_DELETE_FUNCTION  DeleteFunction 
)

Queues a work item to a work queue.

Parameters
WorkQueueA work queue object.
FunctionA function to execute.
ContextA user-defined value to pass to the function.
DeleteFunctionA callback function that is executed when the work queue item is about to be freed.

Definition at line 380 of file workqueue.c.

VOID PhWaitForWorkQueue ( _Inout_ PPH_WORK_QUEUE  WorkQueue)

Waits for all queued work items to be executed.

Parameters
WorkQueueA work queue object.

Definition at line 184 of file workqueue.c.

VOID PhWorkQueueInitialization ( VOID  )

Definition at line 47 of file workqueue.c.