YACLib
C++ library for concurrent tasks execution
Loading...
Searching...
No Matches
yaclib::detail::fiber::FiberBase Class Reference

#include <fiber_base.hpp>

Inheritance diagram for yaclib::detail::fiber::FiberBase:
[legend]
Collaboration diagram for yaclib::detail::fiber::FiberBase:
[legend]

Public Types

using Id = std::uint64_t
 

Public Member Functions

 FiberBase ()
 
void SetJoiningFiber (FiberBase *joining_fiber) noexcept
 
Id GetId () const noexcept
 
void Resume ()
 
void Suspend ()
 
FiberState GetState () noexcept
 
void SetState (FiberState state) noexcept
 
void SetThreadDead () noexcept
 
bool IsThreadAlive () const noexcept
 
voidGetTLS (std::uint64_t id, std::unordered_map< std::uint64_t, void * > &defaults)
 
void SetTLS (std::uint64_t id, void *value)
 
virtual ~FiberBase ()=default
 
- Public Member Functions inherited from yaclib::detail::fiber::Node
bool Erase ()
 

Static Public Member Functions

static IStackAllocatorGetAllocator () noexcept
 

Protected Member Functions

void Start ()
 
void Exit ()
 

Protected Attributes

ExecutionContext _context {}
 
Stack _stack
 
std::exception_ptr _exception
 

Additional Inherited Members

- Public Attributes inherited from yaclib::detail::fiber::Node
Nodeprev {this}
 
Nodenext {this}
 

Detailed Description

Definition at line 27 of file fiber_base.hpp.

Member Typedef Documentation

◆ Id

Definition at line 29 of file fiber_base.hpp.

Constructor & Destructor Documentation

◆ FiberBase()

yaclib::detail::fiber::FiberBase::FiberBase ( )

Definition at line 12 of file fiber_base.cpp.

◆ ~FiberBase()

virtual yaclib::detail::fiber::FiberBase::~FiberBase ( )
virtualdefault

Member Function Documentation

◆ Exit()

void yaclib::detail::fiber::FiberBase::Exit ( )
protected

◆ GetAllocator()

IStackAllocator & yaclib::detail::fiber::FiberBase::GetAllocator ( )
staticnoexcept

Definition at line 78 of file fiber_base.cpp.

References yaclib::detail::fiber::sAllocator.

Referenced by yaclib::fiber::SetStackSize().

◆ GetId()

FiberBase::Id yaclib::detail::fiber::FiberBase::GetId ( ) const
noexcept

◆ GetState()

FiberState yaclib::detail::fiber::FiberBase::GetState ( )
noexcept

Definition at line 50 of file fiber_base.cpp.

Referenced by yaclib::detail::fiber::Thread::join().

◆ GetTLS()

void * yaclib::detail::fiber::FiberBase::GetTLS ( std::uint64_t  id,
std::unordered_map< std::uint64_t, void * > &  defaults 
)

Definition at line 66 of file fiber_base.cpp.

References yaclib::MakeContract().

◆ IsThreadAlive()

bool yaclib::detail::fiber::FiberBase::IsThreadAlive ( ) const
noexcept

Definition at line 62 of file fiber_base.cpp.

◆ Resume()

◆ SetJoiningFiber()

void yaclib::detail::fiber::FiberBase::SetJoiningFiber ( FiberBase joining_fiber)
noexcept

Definition at line 54 of file fiber_base.cpp.

References yaclib::MakeContract().

Referenced by yaclib::detail::fiber::Thread::join().

◆ SetState()

void yaclib::detail::fiber::FiberBase::SetState ( FiberState  state)
noexcept

Definition at line 82 of file fiber_base.cpp.

References yaclib::MakeContract().

Referenced by yaclib::fault::Scheduler::Schedule().

◆ SetThreadDead()

void yaclib::detail::fiber::FiberBase::SetThreadDead ( )
noexcept

Definition at line 58 of file fiber_base.cpp.

◆ SetTLS()

void yaclib::detail::fiber::FiberBase::SetTLS ( std::uint64_t  id,
void value 
)

Definition at line 74 of file fiber_base.cpp.

References yaclib::MakeContract().

◆ Start()

void yaclib::detail::fiber::FiberBase::Start ( )
protected

◆ Suspend()

void yaclib::detail::fiber::FiberBase::Suspend ( )

Member Data Documentation

◆ _context

ExecutionContext yaclib::detail::fiber::FiberBase::_context {}
protected

◆ _exception

std::exception_ptr yaclib::detail::fiber::FiberBase::_exception
protected

Definition at line 63 of file fiber_base.hpp.

Referenced by Resume().

◆ _stack

Stack yaclib::detail::fiber::FiberBase::_stack
protected

Definition at line 62 of file fiber_base.hpp.

Referenced by yaclib::detail::fiber::Fiber< Args >::Fiber().


The documentation for this class was generated from the following files: