If instrumentation is switched off on multithreaded code,
multiple signals in a row handled by different threads could
confuse callgrind.
Callgrind assumed that in post_signal, it has the correct understanding
of the currently running thread. This is not always correct.
Really switch to running thread.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10966
tid, sigNum, alt_stack ? "yes":"no");
/* switch to the thread the handler runs in */
- CLG_(run_thread)(tid);
+ CLG_(switch_thread)(tid);
/* save current execution state */
exec_state_save();
CLG_DEBUG(0, ">> post_signal(TID %d, sig %d)\n",
tid, sigNum);
- CLG_ASSERT(tid == CLG_(current_tid));
+ /* thread switching potentially needed, eg. with instrumentation off */
+ CLG_(switch_thread)(tid);
CLG_ASSERT(sigNum == CLG_(current_state).sig);
/* Unwind call stack of this signal handler.