Callisto Engine
threading_module.h File Reference

Threading module entry point. More...

#include <future>
#include <utility>
#include "../api_status.h"
#include "init_threading_params.h"
#include "type_aliases.h"
#include "async_task.h"
Include dependency graph for threading_module.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  cl::threading::async_result< TIn >
 
class  cl::threading::async_result< void >
 

Functions

template<typename T >
async_result< T > cl::threading::schedule_work (const typed_work< T > &work)
 
template<typename T >
async_handler cl::threading::internal::create_task_handler (const cl::threading::typed_work< T > &work)
 
async_handler cl::threading::internal::create_task_handler (const cl::threading::typed_work< void > &work)
 
scheduler * cl::threading::get_scheduler ()
 Get the active scheduler for the task pool. More...
 
api_status cl::threading::init (const init_threading_params &p)
 Initialize the threading module This should be called once on startup. More...
 
api_status cl::threading::shutdown ()
 Shut down the threading module This should be called once on shutdown. More...
 

Detailed Description

Threading module entry point.

Function Documentation

◆ create_task_handler() [1/2]

template<typename T >
async_handler cl::threading::internal::create_task_handler ( const cl::threading::typed_work< T > &  work)

Internal function for creating a typed asynchronous task handler

Template Parameters
TThe type of work this handler produces
Parameters
workA lambda representing the workload to run asynchronously
Returns

◆ create_task_handler() [2/2]

cl::threading::async_handler cl::threading::internal::create_task_handler ( const cl::threading::typed_work< void > &  work)

Internal void specialization for creating a typed asynchronous task handler

Parameters
work
Returns

◆ get_scheduler()

cl::threading::scheduler * cl::threading::get_scheduler ( )

Get the active scheduler for the task pool.

Returns
The active scheduler

◆ init()

cl::api_status cl::threading::init ( const init_threading_params p)

Initialize the threading module This should be called once on startup.

Parameters
pInitialization parameters
Returns
cl::api_status::ok or a suitable cl::api_status error code

◆ shutdown()

cl::api_status cl::threading::shutdown ( )

Shut down the threading module This should be called once on shutdown.

Returns
cl::api_status::ok or a suitable cl::api_status error code