cartographer-project / cartographer

Cartographer is a system that provides real-time simultaneous localization and mapping (SLAM) in 2D and 3D across multiple platforms and sensor configurations.
Apache License 2.0
7.09k stars 2.25k forks source link

It's possible to construct a common::ThreadPool with zero workers #1785

Closed macmason closed 3 years ago

macmason commented 3 years ago

It's possible to construct a ThreadPool with zero workers. If you then schedule anything, it will hang forever.

I'm happy to follow up with a PR, but would we prefer a CHECK_GE(num_threads, 1) or a call to std::max?

MichaelGrupp commented 3 years ago

I would go for the CHECK if zero is a value that we cannot support. A PR would be good, thanks.

macmason commented 3 years ago

Apparently closed this by accident. Re-opening...

wohe commented 3 years ago

Fixed by #1800.