|
From: Jeremy F. <je...@go...> - 2002-10-23 15:45:40
|
On Wed, 2002-10-23 at 05:55, Nicholas Nethercote wrote:
On 21 Oct 2002, Jeremy Fitzhardinge wrote:
> > As I remember it, the root thread is #1, and if there's no tid in the base
> > block then it must be the root thread. This could be wrong.
>
> Yes, I don't think that assumption is good. If there's no thread in the
> baseBlock, then there's no current (virtual machine) thread running at
> all.
So then what do you do in that case?
A hack. I removed VG_(get_current_tid_1_if_root)() and replaced it with
VG_(get_current_or_recent_tid)(). It returns either the current tid, or
if there is none, the most recently current tid. This works for the
cases where we're acting on behalf of the most recently running thread,
such as when we're doing things in syscalls. A more correct solution
might be to always pass around a ThreadState, but that would require
changing the interface of almost all the tracking functions.
J
|