2021-09-12 20:23:05 +02:00
|
|
|
using System;
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
using Godot.NativeInterop;
|
|
|
|
|
2019-07-18 04:08:24 +02:00
|
|
|
namespace Godot
|
|
|
|
{
|
|
|
|
public static class Dispatcher
|
|
|
|
{
|
2021-09-12 19:50:13 +02:00
|
|
|
internal static GodotTaskScheduler DefaultGodotTaskScheduler;
|
|
|
|
|
2021-09-12 20:23:05 +02:00
|
|
|
[UnmanagedCallersOnly]
|
|
|
|
internal static void InitializeDefaultGodotTaskScheduler()
|
2021-09-12 19:50:13 +02:00
|
|
|
{
|
2021-09-12 20:23:05 +02:00
|
|
|
try
|
|
|
|
{
|
|
|
|
DefaultGodotTaskScheduler = new GodotTaskScheduler();
|
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
{
|
|
|
|
ExceptionUtils.DebugUnhandledException(e);
|
|
|
|
}
|
2021-09-12 19:50:13 +02:00
|
|
|
}
|
2019-07-18 04:08:24 +02:00
|
|
|
|
2021-09-12 19:50:13 +02:00
|
|
|
public static GodotSynchronizationContext SynchronizationContext => DefaultGodotTaskScheduler.Context;
|
2019-07-18 04:08:24 +02:00
|
|
|
}
|
|
|
|
}
|