Mark the main thread as running while the initial memory declarations
are made to the tool so that the tool can associate that memory with
the main thread if it wishes.

Also cleanup existing hacks in the drd tool which worked around the
fact that the core did not set the current thread while declaring the
initial memory.

Path from Bart Van Assche <bart.vanassche@gmail.com>.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7310 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/exp-drd/drd_thread.c b/exp-drd/drd_thread.c
index 8ab9938..4277e1b 100644
--- a/exp-drd/drd_thread.c
+++ b/exp-drd/drd_thread.c
@@ -424,17 +424,14 @@
 
 DrdThreadId thread_get_running_tid(void)
 {
-   // HACK. To do: remove the if-statement and keep the assert.
-   if (VG_(get_running_tid)() != VG_INVALID_THREADID)
-      tl_assert(VG_(get_running_tid)() == s_vg_running_tid);
+   tl_assert(VG_(get_running_tid)() == s_vg_running_tid);
    tl_assert(s_drd_running_tid != DRD_INVALID_THREADID);
    return s_drd_running_tid;
 }
 
 void thread_set_vg_running_tid(const ThreadId vg_tid)
 {
-   // HACK. To do: uncomment the line below.
-   // tl_assert(vg_tid != VG_INVALID_THREADID);
+   tl_assert(vg_tid != VG_INVALID_THREADID);
 
    if (vg_tid != s_vg_running_tid)
    {
@@ -447,10 +444,6 @@
 
 void thread_set_running_tid(const ThreadId vg_tid, const DrdThreadId drd_tid)
 {
-   // HACK. To do: remove the next two lines.
-   if (vg_tid == VG_INVALID_THREADID)
-      return;
-
    tl_assert(vg_tid != VG_INVALID_THREADID);
    tl_assert(drd_tid != DRD_INVALID_THREADID);