16 #ifndef BLOOMBERG_QUANTUM_ICORO_SYNC_H 17 #define BLOOMBERG_QUANTUM_ICORO_SYNC_H 22 #include <quantum/quantum_traits.h> 36 using Ptr = std::shared_ptr<ICoroSync>;
51 virtual void yield() = 0;
55 virtual std::atomic_int&
signal() = 0;
62 virtual void sleep(
const std::chrono::milliseconds& timeMs) = 0;
63 virtual void sleep(
const std::chrono::microseconds& timeUs) = 0;
70 #endif //BLOOMBERG_QUANTUM_ICORO_SYNC_H Definition: quantum_buffer_impl.h:22
virtual ~ICoroSync()=default
Default virtual destructor.
virtual Traits::Yield & getYieldHandle()=0
Retrieve the underlying boost::coroutine object.
Provides an interface to facilitate 'implicit' coroutine yielding within other primitives such as mut...
Definition: quantum_icoro_sync.h:34
std::shared_ptr< ICoroSync > Ptr
Definition: quantum_icoro_sync.h:36
ICoroSync::Ptr ICoroSyncPtr
Definition: quantum_icoro_sync.h:66
virtual void yield()=0
Explicitly yields this coroutine context.
virtual void sleep(const std::chrono::milliseconds &timeMs)=0
Sleeps the coroutine associated with this context for at least 'timeMs' milliseconds or 'timeUs' micr...
virtual std::atomic_int & signal()=0
Accessor to the underlying synchronization variable.
virtual void setYieldHandle(Traits::Yield &yield)=0
Sets the underlying boost::coroutine object so that it can be yielded on.
typename BoostCoro::pull_type Yield
Definition: quantum_traits.h:58