Class ThreadManager
Utility class for managing threads. Use this instead of new Thread() to minimize the possibility of zombie threads.
Inheritance
System.Object
ThreadManager
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Simplic.Threading
Assembly: Simplic.Threading.dll
Syntax
public class ThreadManager
Properties
| Improve this Doc View SourceThreads
Gets a list of all Simplic-managed threads
Declaration
public static List<ThreadInfo> Threads { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<ThreadInfo> |
Methods
| Improve this Doc View SourceGetRunning()
Gets all running threads managed by Simplic
Declaration
public static IEnumerable<ThreadInfo> GetRunning()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ThreadInfo> |
New(ParameterizedThreadStart, ThreadOptions, ThreadType, ThreadImportance, String)
Creates and registers a thread.
Declaration
public static Thread New(ParameterizedThreadStart start, ThreadOptions options, ThreadType type = ThreadType.Other, ThreadImportance importance = ThreadImportance.Unimportant, string name = null)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.ParameterizedThreadStart | start | |
ThreadOptions | options | |
ThreadType | type | |
ThreadImportance | importance | |
System.String | name |
Returns
Type | Description |
---|---|
System.Threading.Thread |
New(ParameterizedThreadStart, Int32, ThreadOptions, ThreadType, ThreadImportance, String)
Creates and registers a thread.
Declaration
public static Thread New(ParameterizedThreadStart start, int maxStackSize, ThreadOptions options, ThreadType type = ThreadType.Other, ThreadImportance importance = ThreadImportance.Unimportant, string name = null)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.ParameterizedThreadStart | start | |
System.Int32 | maxStackSize | |
ThreadOptions | options | |
ThreadType | type | |
ThreadImportance | importance | |
System.String | name |
Returns
Type | Description |
---|---|
System.Threading.Thread |
New(ThreadStart, ThreadOptions, ThreadType, ThreadImportance, String)
Creates and registers a thread.
Declaration
public static Thread New(ThreadStart start, ThreadOptions options, ThreadType type = ThreadType.Other, ThreadImportance importance = ThreadImportance.Unimportant, string name = null)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.ThreadStart | start | |
ThreadOptions | options | |
ThreadType | type | |
ThreadImportance | importance | |
System.String | name |
Returns
Type | Description |
---|---|
System.Threading.Thread |
New(ThreadStart, Int32, ThreadOptions, ThreadType, ThreadImportance, String)
Creates and registers a thread.
Declaration
public static Thread New(ThreadStart start, int maxStackSize, ThreadOptions options, ThreadType type = ThreadType.Other, ThreadImportance importance = ThreadImportance.Unimportant, string name = null)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.ThreadStart | start | |
System.Int32 | maxStackSize | |
ThreadOptions | options | |
ThreadType | type | |
ThreadImportance | importance | |
System.String | name |
Returns
Type | Description |
---|---|
System.Threading.Thread |
Register(ThreadInfo)
Registers a thread to be managed by Simplic
Declaration
public static void Register(ThreadInfo info)
Parameters
Type | Name | Description |
---|---|---|
ThreadInfo | info |
Register(Thread, ThreadType, ThreadImportance, ThreadOptions, String)
Registers a thread to be managed by Simplic
Declaration
public static void Register(Thread thread, ThreadType type, ThreadImportance importance, ThreadOptions options, string name)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.Thread | thread | |
ThreadType | type | |
ThreadImportance | importance | |
ThreadOptions | options | |
System.String | name |