-
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# What's new? - 1.82.9 - **[Fix]** Sophon failing to install games, by @bagusnl & @neon-nyan - Errors such as `EnumFailedVersion` or `InvalidOperationException` - Caused by Sophon data got modified mid-flight before the finalization - **[Fix]** App crashing when minimized to tray on certain system, by @bagusnl - This is caused by missing Windows feature causing the method to be missing, please contact your custom ISOs creator if other errors happened caused by similar 'Incorrect function' error - **[Fix]** Error when trying to uninstall games that do not have AppData entry, by @neon-nyan - **[Fix]** Installation starts before audio package is selected, by @neon-nyan & @bagusnl - **[Imp]** Improved Sophon performance by increasing minimum thread pool available for processing files, by @neon-nyan <details> <summary>Changelog Prefixes</summary> ``` **[New]** **[Imp]** **[Fix]** **[Loc]** **[Doc]** ``` </details>
- Loading branch information
Showing
46 changed files
with
1,127 additions
and
520 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using System; | ||
using System.Threading; | ||
|
||
namespace CollapseLauncher.Helper | ||
{ | ||
/// <summary> | ||
/// Manages the thread pool settings to throttle the number of threads. | ||
/// </summary> | ||
internal partial class ThreadPoolThrottle : IDisposable | ||
{ | ||
private readonly int PreviousThreadCount; | ||
private readonly int PreviousCompletionPortThreadCount; | ||
internal readonly int MultipliedThreadCount; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ThreadPoolThrottle"/> class. | ||
/// </summary> | ||
/// <param name="previousThreadCount">The previous maximum number of worker threads.</param> | ||
/// <param name="previousCompletionPortThreadCount">The previous maximum number of asynchronous I/O threads.</param> | ||
/// <param name="multipliedThreadCount">The multiplied thread count.</param> | ||
private ThreadPoolThrottle(int previousThreadCount, int previousCompletionPortThreadCount, int multipliedThreadCount) | ||
{ | ||
PreviousThreadCount = previousThreadCount; | ||
PreviousCompletionPortThreadCount = previousCompletionPortThreadCount; | ||
MultipliedThreadCount = multipliedThreadCount; | ||
} | ||
|
||
/// <summary> | ||
/// Starts the thread pool throttle by setting the maximum number of threads. | ||
/// </summary> | ||
/// <param name="multiply">The factor to multiply the processor count by to determine the maximum number of threads.</param> | ||
/// <returns>A <see cref="ThreadPoolThrottle"/> instance that can be used to restore the previous thread pool settings.</returns> | ||
public static ThreadPoolThrottle Start(int multiply = 4) | ||
{ | ||
var threadCount = Environment.ProcessorCount * multiply; | ||
ThreadPool.GetMinThreads(out var workerThreads, out var completionPortThreads); | ||
ThreadPool.SetMinThreads(Math.Max(workerThreads, threadCount), | ||
Math.Max(completionPortThreads, threadCount)); | ||
return new ThreadPoolThrottle(workerThreads, completionPortThreads, threadCount); | ||
} | ||
|
||
/// <summary> | ||
/// Restores the previous thread pool settings. | ||
/// </summary> | ||
public void Dispose() | ||
{ | ||
ThreadPool.SetMaxThreads(PreviousThreadCount, PreviousCompletionPortThreadCount); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.