mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[All] Change threading to be global
This commit is contained in:
@@ -18,6 +18,9 @@ namespace SabreTools.Library.Data
|
||||
/// <param name="name">The name to be displayed as the program</param>B
|
||||
public static void Start(string name)
|
||||
{
|
||||
// Set the maximum number of threads right off the bat
|
||||
System.Threading.ThreadPool.SetMaxThreads(Globals.MaxThreads, Globals.MaxThreads);
|
||||
|
||||
// Dynamically create the header string, adapted from http://stackoverflow.com/questions/8200661/how-to-align-string-in-fixed-length-string
|
||||
int width = Console.WindowWidth - 3;
|
||||
string border = "+" + new string('-', width) + "+";
|
||||
|
||||
@@ -36,9 +36,14 @@ namespace SabreTools.Library.Data
|
||||
}
|
||||
set { _logger = value; }
|
||||
}
|
||||
public static int MaxDegreeOfParallelism
|
||||
public static int MaxThreads
|
||||
{
|
||||
set { _maxDegreeOfParallelism = value; }
|
||||
get { return _maxDegreeOfParallelism; }
|
||||
set
|
||||
{
|
||||
_maxDegreeOfParallelism = value;
|
||||
System.Threading.ThreadPool.SetMaxThreads(_maxDegreeOfParallelism, _maxDegreeOfParallelism);
|
||||
}
|
||||
}
|
||||
public static ParallelOptions ParallelOptions
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user