Пример #1
0
        /// <summary>
        /// Forks this current task (actually takes the current thread)
        /// </summary>
        /// <returns>The new PID (zero for child, >0 for childs PID)</returns>
        public int Fork()
        {
            Task newTask = Clone();

            newTask.AddThread(CurrentThread.Clone());
            Tasking.ScheduleTask(newTask);
            return(newTask.PID != PID ? newTask.PID : 0);
        }