Skip to content

Commit 7eb81c1

Browse files
d-jagodalukebakken
authored andcommitted
Start MainLoop in a task marked as long running
1 parent f3382d3 commit 7eb81c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

projects/RabbitMQ.Client/client/impl/Connection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ public void MaybeStartHeartbeatTimers()
850850

851851
public void StartMainLoop(bool useBackgroundThread)
852852
{
853-
_mainLoopTask = Task.Run((Action)MainLoop);
853+
_mainLoopTask = Task.Factory.StartNew(MainLoop, TaskCreationOptions.LongRunning | TaskCreationOptions.DenyChildAttach);
854854
}
855855

856856
public void HeartbeatReadTimerCallback(object state)

0 commit comments

Comments
 (0)