1 #ifndef LIBCOMMUNISM_COTHREADIMPL_H
2 #define LIBCOMMUNISM_COTHREADIMPL_H
30 (void) entry, (
void) stackSize;
73 return this->
stack.size() *
sizeof(uintptr_t);
83 return this->
stack.data();
std::function< void()> Entry
Type alias for an entry point of a cothread.
Main namespace for the libcommunism library.
CothreadImpl * AllocKernelThreadWrapper()
Abstract interface for a platform implementation of cothreads.
CothreadImpl(const Cothread::Entry &entry, const size_t stackSize=0)
virtual void * getStack() const
virtual void switchTo(CothreadImpl *from)=0
virtual ~CothreadImpl()=default
CothreadImpl(const Cothread::Entry &entry, std::span< uintptr_t > stack)
std::span< uintptr_t > stack
Stack used by this cothread, if any.
virtual size_t getStackSize() const
CothreadImpl(std::span< uintptr_t > stack)