Files
Aerofoil/AerofoilPortable/GpFiber_Thread.h

24 lines
457 B
C
Raw Normal View History

2020-09-26 16:45:52 -04:00
#pragma once
#include "IGpFiber.h"
struct IGpThreadEvent;
2020-09-26 16:45:52 -04:00
2021-03-18 17:08:11 -04:00
class GpFiber_Thread final : public IGpFiber
2020-09-26 16:45:52 -04:00
{
public:
2021-03-18 17:08:11 -04:00
explicit GpFiber_Thread(void *thread, IGpThreadEvent *threadEvent);
~GpFiber_Thread();
2020-09-26 16:45:52 -04:00
void YieldTo(IGpFiber *fromFiber) override;
2020-10-12 00:37:11 -04:00
void YieldToTerminal(IGpFiber *fromFiber) override;
2020-09-26 16:45:52 -04:00
void Destroy() override;
private:
2021-03-18 17:08:11 -04:00
static int InternalThreadFunction(void *data);
2020-09-26 16:45:52 -04:00
bool m_isDestroying;
IGpThreadEvent *m_event;
2021-03-18 17:08:11 -04:00
void *m_thread;
2020-09-26 16:45:52 -04:00
};