Removed ThreadPool threads in favour of plain threads.
See NyxStudios/TerrariaAPI-Server@b1d62b6cbd for details.
This commit is contained in:
parent
a7ac433bfa
commit
4eca66a024
4 changed files with 36 additions and 20 deletions
|
|
@ -36,7 +36,16 @@ namespace TShockAPI
|
|||
|
||||
public UpdateManager()
|
||||
{
|
||||
ThreadPool.QueueUserWorkItem(CheckForUpdates);
|
||||
Thread t = new Thread(() => {
|
||||
do {
|
||||
CheckForUpdates(null);
|
||||
} while (true);
|
||||
});
|
||||
|
||||
t.Name = "TShock Update Thread";
|
||||
t.IsBackground = true;
|
||||
|
||||
t.Start();
|
||||
}
|
||||
|
||||
private void CheckForUpdates(object state)
|
||||
|
|
@ -53,7 +62,6 @@ namespace TShockAPI
|
|||
}
|
||||
|
||||
Thread.Sleep(CheckXMinutes * 60 * 1000);
|
||||
ThreadPool.QueueUserWorkItem(CheckForUpdates);
|
||||
}
|
||||
|
||||
public void UpdateCheck(object o)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue