QuantumLibrary
Bloomberg::quantum::YieldingThreadDuration< DURATION > Struct Template Reference

This class provides the same functionality as a coroutine yield when called from a thread context. More...

#include <quantum_yielding_thread.h>

Public Member Functions

void operator() (DURATION time=defaultDuration())
 Yields the current thread either via a busy wait loop or by sleeping it. Behavior is determined at compile time. More...
 

Static Public Member Functions

static DURATION defaultDuration ()
 

Detailed Description

template<class DURATION>
struct Bloomberg::quantum::YieldingThreadDuration< DURATION >

This class provides the same functionality as a coroutine yield when called from a thread context.

Note
For internal use only.

Member Function Documentation

◆ defaultDuration()

template<class DURATION >
static DURATION Bloomberg::quantum::YieldingThreadDuration< DURATION >::defaultDuration ( )
inlinestatic

◆ operator()()

template<class DURATION >
void Bloomberg::quantum::YieldingThreadDuration< DURATION >::operator() ( DURATION  time = defaultDuration())
inline

Yields the current thread either via a busy wait loop or by sleeping it. Behavior is determined at compile time.

Parameters
[in]timeTime used for the sleep duration.