Commit Graph
2 Commits
Author SHA1 Message Date
Cory Benfield 30961d2f05 Properly allow ThreadPool to be started multiple times. (#1572)
Motivation:

Our API documentation claims that NIOThreadPool.start() will tolerate
being called multiple times. However, this wasn't actually true: in
debug mode it'd hit an assertion, and in release mode it would quietly
orphan all its threads and replace them with new ones, leaving there
with twice as many threads and some that wouldn't be closed down.

We should support the functionality we claim we do.

Modifications:

- Fixed the incorrect check for running thread pool state.
- Added a test to validate we actually allow multiple starts.

Result:

Thread pools really can be started multiple times.
2020-06-25 11:14:43 +01:00
Johannes Weiss b2d937b22f shorten NIOThreadPool's thread names (#1466)
Motivation:

Previously, NIOThreadPool would use super long thread names. Linux
doesn't allow more than 15 bytes (+ \0 char) so in the end they would
never get set at all.

Modifications:

- Shorten NIOThreadPool's thread names
- Only take the first 15 characters of thread names in general on Linux

Result:

We don't lose thread names on Linux.
2020-03-31 20:01:56 +01:00