Ejemplo n.º 1
0
 /// <summary>
 /// Creates a new thread as a child of another <see cref="Thread"/>.
 /// </summary>
 /// <param name="name">The (optional) name of the thread. Defaults to the name of the parent "<see cref="Thread.Name"/>_{#}"</param>
 /// <param name="pointer">The <see cref="ThreadPointer"/> contains information about the <see cref="ICommand"/>s that will be run on the <see cref="Thread"/>.</param>
 /// <param name="parent">The parent <see cref="Thread"/> to create this <see cref="Thread"/> instance from. The <see cref="Thread.Context"/>, <see cref="Thread.Capabilities"/>, and other related data will be copied from the parent.</param>
 public Thread(Thread parent, ThreadPointer pointer, string name = null)
 {
     Name         = name ?? $"{parent.Name}_{Guid.NewGuid()}";
     Capabilities = parent.Capabilities;
     Pointer      = pointer;
     Context      = parent.Context;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a new <see cref="Thread"/>
 /// </summary>
 /// <param name="name">The name of the thread.</param>
 /// <param name="capabilities">A collection of capabilities that the <see cref="Thread"/> has to run certain <see cref="ICommand"/> commands.</param>
 /// <param name="pointer">The <see cref="ThreadPointer"/> contains information about the <see cref="ICommand"/>s that will be run on the <see cref="Thread"/>.</param>
 /// <param name="context">Memory context, such as static type information, specific to the environment where the <see cref="Thread"/> is executing.</param>
 public Thread(string name, CapabilitiesCollection capabilities, ThreadPointer pointer, IMemoryGroup context)
 {
     Name         = name;
     Capabilities = capabilities;
     Pointer      = pointer;
     Context      = context;
 }