Make all TCS RunContinuationsAsynchronously

This commit is contained in:
Soreepeong 2024-07-21 20:49:41 +09:00
parent 856c198934
commit 1be5cd452d
14 changed files with 33 additions and 23 deletions

View file

@ -59,7 +59,7 @@ internal sealed class DevTextureSaveMenu : IInternalDisposableService
{
var first = true;
var encoders = textureManager.Wic.GetSupportedEncoderInfos().ToList();
var tcs = new TaskCompletionSource<BitmapCodecInfo>();
var tcs = new TaskCompletionSource<BitmapCodecInfo>(TaskCreationOptions.RunContinuationsAsynchronously);
Service<InterfaceManager>.Get().Draw += DrawChoices;
encoder = await tcs.Task;
@ -108,7 +108,7 @@ internal sealed class DevTextureSaveMenu : IInternalDisposableService
string path;
{
var tcs = new TaskCompletionSource<string>();
var tcs = new TaskCompletionSource<string>(TaskCreationOptions.RunContinuationsAsynchronously);
this.fileDialogManager.SaveFileDialog(
"Save texture...",
$"{encoder.Name.Replace(',', '.')}{{{string.Join(',', encoder.Extensions)}}}",