Minetest 5.9.0-dev
 
Loading...
Searching...
No Matches
lambda.h File Reference
#include <exception>
#include <functional>
#include <memory>
#include "debug.h"
#include "threading/thread.h"
+ Include dependency graph for lambda.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  LambdaThread
 Class returned by runInThread. More...
 

Functions

std::unique_ptr< LambdaThreadrunInThread (const std::function< void()> &fn, const std::string &thread_name="")
 Run a lambda in a separate thread.
 

Function Documentation

◆ runInThread()

std::unique_ptr< LambdaThread > runInThread ( const std::function< void()> &  fn,
const std::string &  thread_name = "" 
)

Run a lambda in a separate thread.

Exceptions will be caught.

Parameters
fnfunction to run
thread_namename for thread
Returns
thread object of type LambdaThread

Referenced by Game::createSingleplayerServer(), and Game::shutdown().

+ Here is the caller graph for this function: