Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
FThreadManager Class Reference

#include <ThreadManager.h>

+ Collaboration diagram for FThreadManager:

Public Member Functions

void AddThread (uint32 ThreadId, FRunnableThread *Thread)
 
void RemoveThread (FRunnableThread *Thread)
 
int32 NumThreads () const
 
void Tick ()
 
void ForEachThread (TFunction< void(uint32 ThreadId, FRunnableThread *Thread)> Func)
 

Static Public Member Functions

static const FStringGetThreadName (uint32 ThreadId)
 
static FThreadManagerGet ()
 

Private Types

using FThreads = TMap<uint32, FRunnableThread*, TInlineSetAllocator<256>>
 

Private Member Functions

TArray< FRunnableThread * > GetForkableThreads ()
 
const FStringGetThreadNameInternal (uint32 ThreadId)
 

Private Attributes

FCriticalSection ThreadsCritical
 
FThreads Threads
 

Friends

class FForkProcessHelper
 

Detailed Description

Manages runnables and runnable threads.

Definition at line 19 of file ThreadManager.h.

Member Typedef Documentation

◆ FThreads

Member Function Documentation

◆ AddThread()

void FThreadManager::AddThread ( uint32 ThreadId,
FRunnableThread * Thread )

Used internally to add a new thread object.

Parameters
Threadthread object.
See also
RemoveThread

◆ ForEachThread()

void FThreadManager::ForEachThread ( TFunction< void(uint32 ThreadId, FRunnableThread *Thread)> Func)

Enumerate each thread.

◆ Get()

static FThreadManager & FThreadManager::Get ( )
static

Access to the singleton object.

Returns
Thread manager object.
+ Here is the caller graph for this function:

◆ GetForkableThreads()

TArray< FRunnableThread * > FThreadManager::GetForkableThreads ( )
private

Returns a list of registered forkable threads

◆ GetThreadName()

static const FString & FThreadManager::GetThreadName ( uint32 ThreadId)
inlinestatic

Returns the name of a thread given its TLS id

Definition at line 53 of file ThreadManager.h.

+ Here is the call graph for this function:

◆ GetThreadNameInternal()

const FString & FThreadManager::GetThreadNameInternal ( uint32 ThreadId)
private

Returns internal name of a the thread given its TLS id

+ Here is the caller graph for this function:

◆ NumThreads()

int32 FThreadManager::NumThreads ( ) const
inline

Get the number of registered threads

Definition at line 47 of file ThreadManager.h.

◆ RemoveThread()

void FThreadManager::RemoveThread ( FRunnableThread * Thread)

Used internally to remove thread object.

Parameters
Threadthread object to be removed.
See also
AddThread

◆ Tick()

void FThreadManager::Tick ( )

Ticks all fake threads and their runnable objects.

Friends And Related Symbol Documentation

◆ FForkProcessHelper

Definition at line 96 of file ThreadManager.h.

Member Data Documentation

◆ Threads

FThreads FThreadManager::Threads
private

List of thread objects to be ticked.

Definition at line 26 of file ThreadManager.h.

◆ ThreadsCritical

FCriticalSection FThreadManager::ThreadsCritical
private

Critical section for ThreadList

Definition at line 22 of file ThreadManager.h.


The documentation for this class was generated from the following file: