trace: initialize trace control in Thread::start

Previously, the trace control of a thread was initialized in its
constructor (which is generic for all components). This has the
disadvantage that the CPU-session-pointer member of the thread might not
be valid at this point. And it cannot be replaced by using the
"deprecated_env" CPU session neither as constructing the deprecated
environment in causes troubles in Core. But as the trace control
shouldn't be needed in Core anyway, the initialization can be moved to
the Thread::start implementation of non-core components. This code
already takes care of the CPU session pointer.

Fixes #2901
This commit is contained in:
Martin Stein
2018-07-02 14:55:01 +02:00
committed by Christian Helmuth
parent 09bf68e8ad
commit fbe9d26c47
6 changed files with 20 additions and 15 deletions

View File

@ -48,9 +48,7 @@ void Thread::_deinit_platform_thread()
void Thread::_init_platform_thread(size_t weight, Type type)
{
/* if no cpu session is given, use it from the environment */
if (!_cpu_session)
_cpu_session = env_deprecated()->cpu_session();
_init_cpu_session_and_trace_control();
if (type == NORMAL)
{