コード例 #1
0
        public void DelayThread(uint threadId, uint delayMs)
        {
            Kernel  kernel = this.Bios._kernel;
            KThread thread = kernel.GetHandleOrNull <KThread>(( int )threadId);

            if (thread == null)
            {
                return;
            }
            thread.Delay(delayMs * 1000, false);
        }
コード例 #2
0
        public void KillThread(uint threadId)
        {
            Kernel  kernel = this.Bios._kernel;
            KThread thread = kernel.GetHandleOrNull <KThread>(( int )threadId);

            if (thread == null)
            {
                return;
            }
            thread.Exit(-1);
        }
コード例 #3
0
        public void ResumeThread(uint threadId)
        {
            Kernel  kernel = this.Bios._kernel;
            KThread thread = kernel.GetHandleOrNull <KThread>(( int )threadId);

            if (thread == null)
            {
                return;
            }
            thread.Resume();
        }
コード例 #4
0
        public void WakeThread(uint threadId)
        {
            Kernel  kernel = this.Bios._kernel;
            KThread thread = kernel.GetHandleOrNull <KThread>(( int )threadId);

            if (thread == null)
            {
                return;
            }
            if ((thread.State == KThreadState.Suspended) ||
                (thread.State == KThreadState.WaitSuspended))
            {
                thread.Resume();
            }
            if (thread.State == KThreadState.Waiting)
            {
                thread.ReleaseWait(false);
            }
        }