Browse Source

Fixed Task static methods for Net3

pull/46/head
Anairkoen Schno 5 years ago
parent
commit
6894766b6c
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