Exemple #1
0
        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);
            }
        }
Exemple #2
0
        void DoStart()
        {
            TCallbackEvent callback = new TCallbackEvent();

            callback.Func = 0;

            m_CallbackSem.WaitOne();

            try {
                m_EventQueue.AddLast(callback);
            }
            finally {
                m_CallbackSem.Release();
            }

            DoSetEvent();
        }
Exemple #3
0
        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();
        }
Exemple #4
0
        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();
        }
Exemple #5
0
        void DoStart()
        {
            TCallbackEvent callback = new TCallbackEvent();

            callback.Func = 0;

            m_CallbackSem.WaitOne();

            try {
                m_EventQueue.AddLast(callback);
            }
            finally {
                m_CallbackSem.Release();
            }

            DoSetEvent();
        }
Exemple #6
0
        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);
            }
        }