From: Nicholas N. <nj...@ca...> - 2002-10-22 08:15:48
|
On Tue, 22 Oct 2002, Julian Seward wrote: > Merging more stuff in. I just did 08-skin-clientreq. I am a heinous slacker. Thanks. > 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 was probably missing something when I wrote it. It always felt nasty to me but I thought it was necessary. IIRC VG_(get_current_tid) returns 0 in some circumstances, I can't remember and/or never understood why. Because thread #0 is some special reserved thread or something, and thread #1 is meant to be the root thread, which I thought corresponded to the only thread for non-threaded programs. But that may be totally bogus. Maybe the #0 being returned was related to the system call wrong-tid bug, I don't know. Jeremy, by now you understand Helgrind much better than I, if you think it should go then please kill it! You must be getting a fairly good idea of how little time I spent testing Helgrind. I just hope that it was quicker for you to fix the existing code rather than to rewrite it from scratch. N |