public void Output(int Kind, byte[] Data, int Size) { if (IsFinished()) { return; } CPUContext CPUContext = StartDelaySuspend(); try { TCallbackEvent callback = new TCallbackEvent(); callback.Func = 3; callback.Kind = Kind; callback.Data = new byte[Size]; Buffer.BlockCopy(Data, 0, callback.Data, 0, Size); if (!m_CallbackSem.WaitOne()) { throw new Exception(); } try { m_EventQueue.AddLast(callback); } finally { m_CallbackSem.Release(); } DoSetEvent(); } finally { EndDelaySuspend(CPUContext); } }
void DoStart() { TCallbackEvent callback = new TCallbackEvent(); callback.Func = 0; m_CallbackSem.WaitOne(); try { m_EventQueue.AddLast(callback); } finally { m_CallbackSem.Release(); } DoSetEvent(); }
void DoTerminate() { TCallbackEvent callback = new TCallbackEvent(); callback.Func = 1; if (!m_CallbackSem.WaitOne()) { throw new Exception(); } try { m_EventQueue.AddLast(callback); } finally { m_CallbackSem.Release(); } DoSetEvent(); }
void DoTerminate() { TCallbackEvent callback = new TCallbackEvent(); callback.Func = 1; if (!m_CallbackSem.WaitOne()) throw new Exception(); try { m_EventQueue.AddLast(callback); } finally { m_CallbackSem.Release(); } DoSetEvent(); }
public void Output(int Kind, byte[] Data, int Size) { if (IsFinished()) return; CPUContext CPUContext = StartDelaySuspend(); try { TCallbackEvent callback = new TCallbackEvent(); callback.Func = 3; callback.Kind = Kind; callback.Data = new byte[Size]; Buffer.BlockCopy(Data, 0, callback.Data, 0, Size); if (!m_CallbackSem.WaitOne()) throw new Exception(); try { m_EventQueue.AddLast(callback); } finally { m_CallbackSem.Release(); } DoSetEvent(); } finally { EndDelaySuspend(CPUContext); } }