mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 14:53:52 +00:00
Cygwin port
This commit is contained in:
29
AerofoilPortable/GpFiber_Thread.cpp
Normal file
29
AerofoilPortable/GpFiber_Thread.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#include "GpFiber_Thread.h"
|
||||
#include "IGpThreadEvent.h"
|
||||
|
||||
GpFiber_Thread::GpFiber_Thread(void *thread, IGpThreadEvent *threadEvent)
|
||||
: m_event(threadEvent)
|
||||
, m_thread(thread)
|
||||
{
|
||||
}
|
||||
|
||||
GpFiber_Thread::~GpFiber_Thread()
|
||||
{
|
||||
m_event->Destroy();
|
||||
}
|
||||
|
||||
void GpFiber_Thread::YieldTo(IGpFiber *toFiber)
|
||||
{
|
||||
static_cast<GpFiber_Thread*>(toFiber)->m_event->Signal();
|
||||
m_event->Wait();
|
||||
}
|
||||
|
||||
void GpFiber_Thread::YieldToTerminal(IGpFiber *toFiber)
|
||||
{
|
||||
static_cast<GpFiber_Thread*>(toFiber)->m_event->Signal();
|
||||
}
|
||||
|
||||
void GpFiber_Thread::Destroy()
|
||||
{
|
||||
delete this;
|
||||
}
|
Reference in New Issue
Block a user