Esempio n. 1
0
        internal static Thread Create(AnalysisContext ac, ThreadId id, string name, Expr arg, Thread parent)
        {
            var thread = new Thread(ac, id, name, arg, parent);

            ac.RegisterThread(thread);
            return(thread);
        }
Esempio n. 2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="ac">AnalysisContext</param>
        /// <param name="name">String</param>
        /// <param name="id">Identifier</param>
        /// <param name="arg">Argument</param>
        /// <param name="parent">Parent</param>
        private Thread(AnalysisContext ac, ThreadId id, string name, Expr arg, Thread parent)
        {
            this.Id   = id;
            this.Name = name;
            this.Arg  = arg;

            this.Parent   = parent;
            this.Children = new HashSet <Thread>();

            this.Function = ac.GetImplementation(this.Name);
            this.Joiner   = null;

            this.IsMain = false;
            if (ac.MainThread.Name.Equals(parent.Name))
            {
                this.CreatedAtRoot = true;
            }
            else
            {
                this.CreatedAtRoot = false;
            }
        }