Browse Source

Fixed Task static methods for Net3

4.0.0-beta
Anairkoen Schno 4 years ago
parent
commit
eca8cb359f
2 changed files with 13 additions and 3 deletions
  1. +7
    -2
      IPA.Loader/Config/ConfigRuntime.cs
  2. +6
    -1
      IPA.Loader/Loader/PluginLoader.cs

+ 7
- 2
IPA.Loader/Config/ConfigRuntime.cs View File

@ -119,8 +119,13 @@ namespace IPA.Config
public static Task TriggerFileLoad(Config config) => loadFactory.StartNew(() => LoadTask(config));
public static Task TriggerLoadAll()
=> Task.WhenAll(configs.Select(TriggerFileLoad));
public static Task TriggerLoadAll() =>
#if NET3
TaskEx
#else
Task
#endif
.WhenAll(configs.Select(TriggerFileLoad));
/// <summary>
/// this is synchronous, unlike <see cref="TriggerFileLoad(Config)"/>


+ 6
- 1
IPA.Loader/Loader/PluginLoader.cs View File

@ -26,7 +26,12 @@ namespace IPA.Loader
/// </summary>
public class PluginLoader
{
internal static Task LoadTask() => Task.Factory.StartNew(() =>
internal static Task LoadTask() =>
#if NET3
TaskEx.Run(() =>
#else
Task.Run(() =>
#endif
{
YeetIfNeeded();


Loading…
Cancel
Save