Merge (from branches/THRCHECK) r6804:

Split the scheduler initialisation into two phases, for reasons I
can't exactly remember.  But I think it was so that the tool can be
told of the initial thread's TID before it is notified of any initial
address range permissions.  Or something like that.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7121 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/pub_core_scheduler.h b/coregrind/pub_core_scheduler.h
index 848ec0b..866e252 100644
--- a/coregrind/pub_core_scheduler.h
+++ b/coregrind/pub_core_scheduler.h
@@ -75,8 +75,15 @@
 // The scheduler.
 extern VgSchedReturnCode VG_(scheduler) ( ThreadId tid );
 
-// Initialise.  Is passed the extent of the root thread's client stack.
-extern void VG_(scheduler_init) ( Addr clstack_end, SizeT clstack_size );
+// Initialise, phase 1.  Zero out VG_(threads), decide on the root
+// ThreadId and initialise the bigLock.
+extern ThreadId VG_(scheduler_init_phase1) ( void );
+
+// Initialise, phase 2.  Is passed the extent of the root thread's
+// client stack and the root ThreadId decided on by phase 1.
+extern void VG_(scheduler_init_phase2) ( ThreadId main_tid, 
+                                         Addr     clstack_end, 
+                                         SizeT    clstack_size );
 
 /* Stats ... */
 extern void VG_(print_scheduler_stats) ( void );