@@ -280,15 +280,15 @@ private class RunnerControl
280280 /// <summary>
281281 /// The task used to signal all requests are stopped
282282 /// </summary>
283- private readonly TaskCompletionSource < bool > m_finishedtask = new TaskCompletionSource < bool > ( ) ;
283+ private readonly TaskCompletionSource < bool > m_finishedtask = new TaskCompletionSource < bool > ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
284284 /// <summary>
285285 /// The task used to signal all handlers to stop
286286 /// </summary>
287- private readonly TaskCompletionSource < bool > m_stoptask = new TaskCompletionSource < bool > ( ) ;
287+ private readonly TaskCompletionSource < bool > m_stoptask = new TaskCompletionSource < bool > ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
288288 /// <summary>
289289 /// The task used to signal waiting for handlers to complete before starting new handlers
290290 /// </summary>
291- private TaskCompletionSource < bool > m_throttletask = new TaskCompletionSource < bool > ( ) ;
291+ private TaskCompletionSource < bool > m_throttletask = new TaskCompletionSource < bool > ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
292292
293293 /// <summary>
294294 /// A logger for reporting the internal log state
@@ -338,7 +338,7 @@ public bool RegisterActive(string logtaskid)
338338 if ( m_debuglogger != null ) m_debuglogger ( "Blocking throttle" , logtaskid , null ) ;
339339 lock ( m_lock )
340340 if ( m_throttletask . Task . IsCompleted )
341- m_throttletask = new TaskCompletionSource < bool > ( ) ;
341+ m_throttletask = new TaskCompletionSource < bool > ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
342342 }
343343
344344 return true ;
@@ -986,7 +986,7 @@ private static async Task Runner(Stream stream, EndPoint endpoint, string logtas
986986 // Set up call context access to this instance
987987 Context . SetCurrentContext ( context ) ;
988988
989- var timeoutcontroltask = new TaskCompletionSource < bool > ( ) ;
989+ var timeoutcontroltask = new TaskCompletionSource < bool > ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
990990 var idletime = TimeSpan . FromSeconds ( config . RequestHeaderReadTimeoutSeconds ) ;
991991
992992 // Set up timeout for processing
0 commit comments