mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 06:53:43 +00:00
29 lines
589 B
C++
29 lines
589 B
C++
#pragma once
|
|
|
|
#include "IGpFiber.h"
|
|
#include "SDL_thread.h"
|
|
|
|
namespace PortabilityLayer
|
|
{
|
|
class HostSystemServices;
|
|
class HostThreadEvent;
|
|
}
|
|
|
|
class GpFiber_SDL final : public IGpFiber
|
|
{
|
|
public:
|
|
explicit GpFiber_SDL(SDL_Thread *thread, PortabilityLayer::HostThreadEvent *threadEvent);
|
|
~GpFiber_SDL();
|
|
|
|
void YieldTo(IGpFiber *fromFiber) override;
|
|
void YieldToTerminal(IGpFiber *fromFiber) override;
|
|
void Destroy() override;
|
|
|
|
private:
|
|
static int SDLCALL InternalThreadFunction(void *data);
|
|
|
|
bool m_isDestroying;
|
|
PortabilityLayer::HostThreadEvent *m_event;
|
|
SDL_Thread *m_thread;
|
|
};
|