Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly created threads now set IsBackground=true to avoid prevent… #354

Merged
merged 1 commit into from
Jan 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/NATS.Client/Conn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,7 @@ private void spinUpSocketWatchers()
readLoopStartEvent.Set();
readLoop();
});
t.IsBackground = true;
t.Start();
t.Name = generateThreadName("Reader");
wg.Add(t);
Expand All @@ -998,6 +999,7 @@ private void spinUpSocketWatchers()
flusherStartEvent.Set();
flusher();
});
t.IsBackground = true;
t.Start();
t.Name = generateThreadName("Flusher");
wg.Add(t);
Expand Down Expand Up @@ -1481,6 +1483,7 @@ private void processReconnect()
{
doReconnect();
});
t.IsBackground = true;
t.Name = generateThreadName("Reconnect");
t.Start();
}
Expand Down
2 changes: 2 additions & 0 deletions src/Samples/Benchmark/Benchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ void runReqReply(string testName, long testCount, long testSize)
subConn.Flush();
}
});
t.IsBackground = true;
t.Start();

Thread.Sleep(1000);
Expand Down Expand Up @@ -413,6 +414,7 @@ async Task runReqReplyAsync(string testName, long testCount, long testSize)
subConn.Flush();
}
});
t.IsBackground = true;
t.Start();

Thread.Sleep(1000);
Expand Down