Ark Server API (ASA) - Wiki
|
#include <QueuedThreadPool.h>
Public Member Functions | |
virtual bool | Create (uint32 InNumQueuedThreads, uint32 StackSize=(32 *1024), EThreadPriority ThreadPriority=TPri_Normal, const TCHAR *Name=TEXT("UnknownThreadPool"))=0 |
virtual void | Destroy ()=0 |
virtual void | AddQueuedWork (IQueuedWork *InQueuedWork, EQueuedWorkPriority InQueuedWorkPriority=EQueuedWorkPriority::Normal)=0 |
virtual bool | RetractQueuedWork (IQueuedWork *InQueuedWork)=0 |
virtual int32 | GetNumThreads () const =0 |
FQueuedThreadPool () | |
virtual | ~FQueuedThreadPool () |
Static Public Member Functions | |
static FQueuedThreadPool * | Allocate () |
Static Public Attributes | |
static uint32 | OverrideStackSize |
Interface for queued thread pools.
This interface is used by all queued thread pools. It used as a callback by FQueuedThreads and is used to queue asynchronous work for callers.
Definition at line 103 of file QueuedThreadPool.h.
FQueuedThreadPool::FQueuedThreadPool | ( | ) |
|
virtual |
|
pure virtual |
Checks to see if there is a thread available to perform the task. If not, it queues the work for later. Otherwise it is immediately dispatched.
InQueuedWork | The work that needs to be done asynchronously |
InQueuedWorkPriority | The priority at which to process this task |
Implemented in FQueuedThreadPoolWrapper, FQueuedThreadPoolDynamicWrapper, FQueuedThreadPoolTaskGraphWrapper, and FQueuedLowLevelThreadPool.
|
static |
Allocates a thread pool
|
pure virtual |
Creates the thread pool with the specified number of threads
InNumQueuedThreads | Specifies the number of threads to use in the pool |
StackSize | The size of stack the threads in the pool need (32K default) |
ThreadPriority | priority of new pool thread |
Name | optional name for the pool to be used for instrumentation |
Implemented in FQueuedLowLevelThreadPool, FQueuedThreadPoolWrapper, and FQueuedThreadPoolTaskGraphWrapper.
Tells the pool to clean up all background threads
Implemented in FQueuedThreadPoolWrapper, FQueuedThreadPoolTaskGraphWrapper, and FQueuedLowLevelThreadPool.
Get the number of queued threads
Implemented in FQueuedThreadPoolWrapper, FQueuedThreadPoolTaskGraphWrapper, and FQueuedLowLevelThreadPool.
|
pure virtual |
Attempts to retract a previously queued task.
InQueuedWork | The work to try to retract |
Implemented in FQueuedThreadPoolWrapper, FQueuedThreadPoolTaskGraphWrapper, and FQueuedLowLevelThreadPool.
|
static |
Stack size for threads created for the thread pool. Can be overridden by other projects. If 0 means to use the value passed in the Create method.
Definition at line 162 of file QueuedThreadPool.h.