=== modified file 'src/w32proc.c' --- trunk/src/w32proc.c 2010-06-04 14:13:35 +0000 +++ patched/src/w32proc.c 2010-06-14 05:53:50 +0000 @@ -121,9 +121,17 @@ { char buf[1024]; va_list args; + char *buf_pos = buf; + + /* On NT add thread id */ +#ifdef WINDOWSNT + DWORD thread_id = GetCurrentThreadId (); + sprintf (buf_pos, "[Th%04x] ", thread_id); + buf_pos = buf_pos + 10; +#endif va_start (args, fmt); - vsprintf (buf, fmt, args); + vsprintf (buf_pos, fmt, args); va_end (args); OutputDebugString (buf); } @@ -304,8 +312,16 @@ read-ahead has completed, whether successfully or not. */ if (!SetEvent (cp->char_avail)) { - DebPrint (("reader_thread.SetEvent failed with %lu for fd %ld\n", - GetLastError (), cp->fd)); + DebPrint (("reader_thread.SetEvent failed with %lu for fd %ld, pid %ld\n", + GetLastError (), cp->fd, cp->pid)); + /* It fails a couple of times with + + warning: reader_thread.SetEvent failed with 6 for fd -1 + + where 6 is + + ERROR_INVALID_HANDLE 6 (0x6) The handle is invalid. + */ return 1; }