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

            callback.Func = 0;

            m_CallbackSem.WaitOne();

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

            DoSetEvent();
        }
예제 #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();
        }
예제 #4
0
파일: Kernel.cs 프로젝트: h7ga40/uITron3
        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();
        }
예제 #5
0
파일: Kernel.cs 프로젝트: h7ga40/uITron3
        void DoStart()
        {
            TCallbackEvent callback = new TCallbackEvent();

            callback.Func = 0;

            m_CallbackSem.WaitOne();

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

            DoSetEvent();
        }
예제 #6
0
파일: Kernel.cs 프로젝트: h7ga40/uITron3
        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);
            }
        }