earliest injection: handle extra early threads
From bruen...@google.com on November 29, 2011 10:11:01
my earliest injection ( issue #234 ) today restores its hook immediately. there can be super-early threads when injected from outside (including from system itself during shutdown and other times) (and really there's nothing special about the main thread: whoever gets to init routine first is the initializer and will then be the DR intializer). the idea is to leave the hook but change it to spin (or if manage to get syscall support, wait) so we can queue up these threads until DR is fully initialized.
note that in the past we discussed ways to try and avoid any other thread being schedulable until we were set up, via SetProcessAffinityMask(0) or sthg, but none of those panned out
this would block windbg's thread as well and if windbg can handle that would enable debugging at pre-Ldr-init time
Original issue: http://code.google.com/p/dynamorio/issues/detail?id=627