File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -58,13 +58,11 @@ protected override void ExecuteTask(IRunnable run)
58
58
59
59
try
60
60
{
61
- // Actors should not run with ActorCellKeepingSynchronizationContext otherwise continuations in
62
- // async message handlers will use ActorCellKeepingSynchronizationContext instead of ActorTaskScheduler
63
- // which cause ActorContext to be incorrect.
64
- if ( currentSyncContext is ActorCellKeepingSynchronizationContext )
65
- {
66
- SynchronizationContext . SetSynchronizationContext ( null ) ;
67
- }
61
+ // Actors should not run with ActorCellKeepingSynchronizationContext
62
+ // (or any sync context that wraps ActorCellKeepingSynchronizationContext, e.g. Xunit's AsyncTestSyncContext)
63
+ // otherwise continuations in async message handlers will use ActorCellKeepingSynchronizationContext
64
+ // instead of ActorTaskScheduler which causes ActorContext to be incorrect.
65
+ SynchronizationContext . SetSynchronizationContext ( null ) ;
68
66
69
67
run . Run ( ) ;
70
68
}
You can’t perform that action at this time.
0 commit comments