Use default task scheduler.

This commit is contained in:
Ottermandias 2024-03-18 16:50:26 +01:00
parent 0ec440c388
commit 9f7b95746d
12 changed files with 16 additions and 16 deletions

@ -1 +1 @@
Subproject commit 1be9365d048bf1da3700e8cf1df9acbe42523f5c
Subproject commit 5a2e12a1acd6760a3a592447a92215135e79197c

@ -1 +1 @@
Subproject commit c0c7eb0dedb32ea83b019626abba041e90a95319
Subproject commit c39f683d65d4541e9f97ed4ea1abcb10e8ca5690

View file

@ -41,7 +41,7 @@ public partial class IndividualCollections
saver.ImmediateSave(parent);
IsLoaded = true;
Loaded.Invoke();
});
}, TaskScheduler.Default);
return false;
}

View file

@ -162,7 +162,7 @@ public sealed class ModelManager(IFramework framework, ActiveCollections collect
{
return _tasks.TryRemove(a, out var unused);
}
}, CancellationToken.None);
}, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Default);
return (t, token);
}).Item1;
}
@ -178,7 +178,7 @@ public sealed class ModelManager(IFramework framework, ActiveCollections collect
throw task.Exception;
return process(action);
});
}, TaskScheduler.Default);
private class ExportToGltfAction(
ModelManager manager,

View file

@ -46,12 +46,12 @@ public partial class TexToolsImporter : IDisposable
ExtractedMods = new List<(FileInfo, DirectoryInfo?, Exception?)>(count);
_token = _cancellation.Token;
Task.Run(ImportFiles, _token)
.ContinueWith(_ => CloseStreams())
.ContinueWith(_ => CloseStreams(), TaskScheduler.Default)
.ContinueWith(_ =>
{
foreach (var (file, dir, error) in ExtractedMods)
handler(file, dir, error);
});
}, TaskScheduler.Default);
}
private void CloseStreams()

View file

@ -64,7 +64,7 @@ public sealed class TextureManager : SingleTaskQueue, IDisposable
{
var token = new CancellationTokenSource();
var task = Enqueue(a, token.Token);
task.ContinueWith(_ => _tasks.TryRemove(a, out var unused), CancellationToken.None);
task.ContinueWith(_ => _tasks.TryRemove(a, out var unused), CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Default);
return (task, token);
}).Item1;
}

View file

@ -23,7 +23,7 @@ public class ModCacheManager : IDisposable
_communicator.ModPathChanged.Subscribe(OnModPathChange, ModPathChanged.Priority.ModCacheManager);
_communicator.ModDataChanged.Subscribe(OnModDataChange, ModDataChanged.Priority.ModCacheManager);
_communicator.ModDiscoveryFinished.Subscribe(OnModDiscoveryFinished, ModDiscoveryFinished.Priority.ModCacheManager);
identifier.Awaiter.ContinueWith(_ => OnIdentifierCreation());
identifier.Awaiter.ContinueWith(_ => OnIdentifierCreation(), TaskScheduler.Default);
OnModDiscoveryFinished();
}

View file

@ -74,7 +74,7 @@ public abstract class AsyncServiceWrapper<T> : IDisposable
{
if (!_isDisposed)
FinishedCreation?.Invoke();
}, null);
}, TaskScheduler.Default);
}
public void Dispose()

View file

@ -92,7 +92,7 @@ public partial class ModEditWindow
.ToList();
});
task.ContinueWith(t => { GamePaths = FinalizeIo(t); });
task.ContinueWith(t => { GamePaths = FinalizeIo(t); }, TaskScheduler.Default);
}
private EstManipulation[] GetCurrentEstManipulations()
@ -130,7 +130,7 @@ public partial class ModEditWindow
BeginIo();
_edit._models.ExportToGltf(ExportConfig, Mdl, sklbPaths, ReadFile, outputPath)
.ContinueWith(FinalizeIo);
.ContinueWith(FinalizeIo, TaskScheduler.Default);
}
/// <summary> Import a model from an interchange format. </summary>
@ -144,7 +144,7 @@ public partial class ModEditWindow
var mdlFile = FinalizeIo(task, result => result.Item1, result => result.Item2);
if (mdlFile != null)
FinalizeImport(mdlFile);
});
}, TaskScheduler.Default);
}
/// <summary> Finalise the import of a .mdl, applying any post-import transformations and state updates. </summary>

View file

@ -255,7 +255,7 @@ public partial class ModEditWindow
return;
_framework.RunOnFrameworkThread(() => tex.Reload(_textures));
});
}, TaskScheduler.Default);
}
private Vector2 GetChildWidth()

View file

@ -326,7 +326,7 @@ public partial class ModEditWindow : Window, IDisposable
else if (ImGuiUtil.DrawDisabledButton("Re-Duplicate and Normalize Mod", Vector2.Zero, tt, !_allowReduplicate && !modifier))
{
_editor.ModNormalizer.Normalize(Mod!);
_editor.ModNormalizer.Worker.ContinueWith(_ => _editor.LoadMod(Mod!, _editor.GroupIdx, _editor.OptionIdx));
_editor.ModNormalizer.Worker.ContinueWith(_ => _editor.LoadMod(Mod!, _editor.GroupIdx, _editor.OptionIdx), TaskScheduler.Default);
}
if (!_editor.Duplicates.Worker.IsCompleted)

View file

@ -33,7 +33,7 @@ public class IndividualAssignmentUi : IDisposable
_actors = actors;
_collectionManager = collectionManager;
_communicator.CollectionChange.Subscribe(UpdateIdentifiers, CollectionChange.Priority.IndividualAssignmentUi);
_actors.Awaiter.ContinueWith(_ => SetupCombos());
_actors.Awaiter.ContinueWith(_ => SetupCombos(), TaskScheduler.Default);
}
public string PlayerTooltip { get; private set; } = NewPlayerTooltipEmpty;