Pyrogenesis  trunk
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
Threading Namespace Reference

Light-weight threading utilities. More...

Namespaces

 anonymous_namespace{TaskManager.cpp}
 

Classes

struct  HandleExceptions
 
struct  HandleExceptionsBase
 Wrap a function to handle exceptions. More...
 
struct  HandleExceptionsBase< functionPtr, void(*)(Types...)>
 
class  TaskManager
 The task manager creates all worker threads on initialisation, and manages the task queues. More...
 
class  Thread
 Light wrapper around std::thread. More...
 
class  WorkerThread
 Worker thread: process the taskManager queues until killed. More...
 

Typedefs

using QueueItem = std::function< void()>
 

Enumerations

enum  TaskPriority { TaskPriority::NORMAL, TaskPriority::LOW }
 

Functions

bool IsMainThread ()
 Returns whether the current thread is the 'main' thread (i.e. More...
 
void SetMainThread ()
 Set the current thread as the 'main' thread. More...
 

Variables

std::unique_ptr< TaskManagerg_TaskManager
 

Detailed Description

Light-weight threading utilities.

Implemented in Threading.cpp. Split from Threading because this is included (via profilers) in most files.

Typedef Documentation

◆ QueueItem

using Threading::QueueItem = typedef std::function<void()>

Enumeration Type Documentation

◆ TaskPriority

Enumerator
NORMAL 
LOW 

Function Documentation

◆ IsMainThread()

bool Threading::IsMainThread ( )

Returns whether the current thread is the 'main' thread (i.e.

matches an earlier call to SetMainThread).

◆ SetMainThread()

void Threading::SetMainThread ( )

Set the current thread as the 'main' thread.

(This is called during engine initialisation.)

Variable Documentation

◆ g_TaskManager

std::unique_ptr<TaskManager> Threading::g_TaskManager