This repository was archived by the owner on Dec 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ public ApplicationManagerBase(SynchronizationContext synchronizationContext)
1717 {
1818 SynchronizationContext = synchronizationContext ;
1919 SynchronizationContext . SetSynchronizationContext ( SynchronizationContext ) ;
20- ThreadingHelper . SetMainThread ( ) ;
20+ ThreadingHelper . SetUIThread ( ) ;
2121 UIScheduler = TaskScheduler . FromCurrentSynchronizationContext ( ) ;
2222 ThreadingHelper . MainThreadScheduler = UIScheduler ;
2323 TaskManager = new TaskManager ( UIScheduler ) ;
Original file line number Diff line number Diff line change @@ -10,14 +10,14 @@ static class ThreadingHelper
1010 public static TaskScheduler MainThreadScheduler { get ; set ; }
1111
1212 public static int MainThread { get ; set ; }
13- public static bool InMainThread { get { return MainThread == 0 || Thread . CurrentThread . ManagedThreadId == MainThread ; } }
13+ static bool InMainThread { get { return MainThread == 0 || Thread . CurrentThread . ManagedThreadId == MainThread ; } }
1414
15- public static void SetMainThread ( )
15+ public static void SetUIThread ( )
1616 {
1717 MainThread = Thread . CurrentThread . ManagedThreadId ;
1818 }
1919
20- public static bool InUIThread => ( ! Guard . InUnitTestRunner && InMainThread ) || ! ( Guard . InUnitTestRunner ) ;
20+ public static bool InUIThread => InMainThread || Guard . InUnitTestRunner ;
2121
2222 /// <summary>
2323 /// Switch to the UI thread
@@ -97,7 +97,7 @@ public bool IsCompleted
9797 {
9898 get
9999 {
100- return ( this . scheduler == TaskManager . Instance . UIScheduler && InMainThread ) || ( this . scheduler != TaskManager . Instance . UIScheduler && ! InMainThread ) ;
100+ return ( this . scheduler == TaskManager . Instance . UIScheduler && InUIThread ) || ( this . scheduler != TaskManager . Instance . UIScheduler && ! InUIThread ) ;
101101 }
102102 }
103103
You can’t perform that action at this time.
0 commit comments