Ejemplo n.º 1
0
        public override void StartYarn(Yarn yarn, Task task)
        {
            YarnOfThread yarnOfThread = ((YarnOfThread)yarn);

            yarnOfThread.Thread.Task = task;
            task.OnBeforeRun        += yarnOfThread.TaskBeforeRun;
            yarnOfThread.Thread.Start();
        }
Ejemplo n.º 2
0
        public override void TerminateYarn(Yarn yarn)
        {
            YarnOfThread LYarn = (YarnOfThread)yarn;

            if (LYarn.Thread.TheThread == null)
            {
                this.ReleaseYarn(yarn);
                return;
            }
            if (LYarn.Thread.TheThread.ThreadState != ThreadState.Unstarted)
            {
                LYarn.Thread.Stop();
            }
        }