A functor at thread spawn?

A functor at thread spawn?

It would be handy to be able to set a functor that gets invoked near the top of a newly spawned TBB worker thread.  There are some things that I would like to do when TBB starts a worker thread.  These are mostly for debugging related tasks, but don't just want to have it available in debug build.  Some examples are to initialize a bit of thread local storage, track thread ids, set thread names (on linux, at least) and so forth.

Is there any existing mechanism to do this?  Could one be added, if not?

 

1 envío / 0 nuevos
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.