offset thread ids where possible (#130)

- configure known background threads to start indexing down from TIMEMORY_MAX_THREADS
- invoke sampling::shutdown() instead of just blocking signals where possible
This commit is contained in:
Jonathan R. Madsen
2022-08-08 08:37:37 -05:00
committed by GitHub
parent ac5ce00561
commit 1343c6722a
5 changed files with 25 additions and 7 deletions
@@ -74,10 +74,11 @@ get_sampler_is_sampling()
void
sampler::poll(std::atomic<State>* _state, nsec_t _interval, promise_t* _ready)
{
OMNITRACE_SCOPED_THREAD_STATE(ThreadState::Internal);
threading::offset_this_id(true);
threading::set_thread_name("omni.sampler");
OMNITRACE_SCOPED_THREAD_STATE(ThreadState::Internal);
// notify thread started
if(_ready) _ready->set_value();