|
From: Julian S. <js...@ac...> - 2002-10-22 04:39:26
|
[Nick -- q for you below]
Merging more stuff in. I just did 08-skin-clientreq.
Also partially did 13-track-condvar-mutex. I agree, the tracking
was wrong. However, I couldn't see the purpose of the part of
the patch dealing with the value of vg_tid_currently_in_baseBlock
when baseBlock is empty and so didn't merge that bit (shown
below). It seems like, with that change, it will be impossible to
know from the value of vg_tid_currently_in_baseBlock whether or
not baseBlock is "full".
Nick: I spotted the infamous (?) VG_(get_current_tid_1_if_root)
and specifically this:
if (0 == vg_tid_currently_in_baseBlock)
return 1; /* root thread */
What's the meaning of the 0 here? Where is it set? AFAICS the only
valid values of vg_tid_currently_in_baseBlock are either 1 .. VG_N_THREADS
or VG_INVALID_THREADID, so I guess I'm missing something here?
I don't feel like I'm seeing a consistent story I'm happy with re
vg_tid_currently_in_baseBlock -- can you two clarify?
J
@@ -468,7 +468,7 @@ void VG_(save_thread_state) ( ThreadId t
Int i;
const UInt junk = 0xDEADBEEF;
- vg_assert(vg_tid_currently_in_baseBlock != VG_INVALID_THREADID);
+ vg_assert(vg_tid_currently_in_baseBlock == tid);
/* We don't copy out the LDT entry, because it can never be changed
@@ -2168,6 +2168,7 @@ void do__apply_in_new_thread ( ThreadId
/* Copy the parent's CPU state into the child's, in a roundabout
way (via baseBlock). */
VG_(load_thread_state)(parent_tid);
+ vg_tid_currently_in_baseBlock = tid;
VG_(save_thread_state)(tid);
/* Consider allocating the child a stack, if the one it already has
|