Skip to content
Snippets Groups Projects
Commit 5471fe7b authored by j2-tulloch's avatar j2-tulloch :speech_balloon:
Browse files

Upload New File

parent ec6226e5
Branches
No related tags found
No related merge requests found
#ifndef FIBER_H
#define FIBER_H
#include <array>
#include "context.h"
class fiber {
private:
Context context_;
std::array<char, 4096> stack_;
char* stack_bottom_;
char* stack_top_;
void* data_;
bool is_finished;
public:
fiber(void (*function)(void*), void* data);
~fiber();
Context* get_context();
void* get_data() const;
void yield();
void finish() {
is_finished = true;
}
bool finished() const{
return is_finished;}
};
#endif // FIBER_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment