Mercury Currency Engine
Classes | Functions
coroutine.hpp File Reference
#include <thread>
#include <memory>
#include <boost/coroutine2/all.hpp>
#include "function_utility.hpp"
Include dependency graph for coroutine.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mce::coroutine
 

Functions

coroutine *& mce::detail::tl_this_coroutine ()
 
bool mce::in_coroutine ()
 Returns true if executing in a coroutine, else false.
 
coroutine * mce::this_coroutine ()
 
void mce::yield ()
 

Detailed Description

Wrapper coroutine object around boost coroutine base types

Function Documentation

◆ this_coroutine()

coroutine* mce::this_coroutine ( )
inline

Return a pointer to the currently running coroutine object. If not running in a coroutine returns nullptr.

◆ yield()

void mce::yield ( )
inline

Yield out of the current coroutine. No effect if running in a raw thread.