Some overloads of Task.ContinueWith do not take a SynchronizationContext.
Actually, none of them take a SynchronizationContext
, but some take a TaskScheduler
.
What SynchronizationContext do they use to schedule the new task?
None! By default, the continuation is scheduled by the current scheduler (TaskScheduler.Current
), which, when not called from a Task
, is TaskScheduler.Default
. So the continuation is run on a thread from the thread pool. ThreadPool
threads don't have an associated synchronization context (unless you explicitly set one).