Open Barsonax opened 6 years ago
Note: Some potentially related research regarding synchronization contexts can also be found in issue #295. Might be worth looking at as well, with regard to avoiding deadlock potential in manual synchronization adjustments.
In pathfindax iam passing the synchronization context as a constructor parameter here instead of it being static (note that I also added interfaces). I do think such a approach would require a custom awaitable though. On the other hand it removes the evil static state.
Summary
Currently inside the editor duality uses the WindowsFormsSynchronizationContext. However outside the editor it uses no SynchronizationContext (which means this context is either null or equal to SynchronizationContext. This can cause code to behave in a different way when running outside the editor and most likely it will break if this is the case.
To fix this inconsistency the following solutions could be applied:
How to reproduce
Workaround
Analysis
If going for 1:
If going for 2:
If going for 3: