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)
17
17
{
18
18
SynchronizationContext = synchronizationContext ;
19
19
SynchronizationContext . SetSynchronizationContext ( SynchronizationContext ) ;
20
- ThreadingHelper . SetMainThread ( ) ;
20
+ ThreadingHelper . SetUIThread ( ) ;
21
21
UIScheduler = TaskScheduler . FromCurrentSynchronizationContext ( ) ;
22
22
ThreadingHelper . MainThreadScheduler = UIScheduler ;
23
23
TaskManager = new TaskManager ( UIScheduler ) ;
Original file line number Diff line number Diff line change @@ -10,14 +10,14 @@ static class ThreadingHelper
10
10
public static TaskScheduler MainThreadScheduler { get ; set ; }
11
11
12
12
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 ; } }
14
14
15
- public static void SetMainThread ( )
15
+ public static void SetUIThread ( )
16
16
{
17
17
MainThread = Thread . CurrentThread . ManagedThreadId ;
18
18
}
19
19
20
- public static bool InUIThread => ( ! Guard . InUnitTestRunner && InMainThread ) || ! ( Guard . InUnitTestRunner ) ;
20
+ public static bool InUIThread => InMainThread || Guard . InUnitTestRunner ;
21
21
22
22
/// <summary>
23
23
/// Switch to the UI thread
@@ -97,7 +97,7 @@ public bool IsCompleted
97
97
{
98
98
get
99
99
{
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 ) ;
101
101
}
102
102
}
103
103
You can’t perform that action at this time.
0 commit comments