* cygthread.cc (cygthread::stub): Add better debug output.

(cygthread::cygthread): Ditto.
(cygthread::terminate_thread): Ditto.  Move inuse test earlier or suffer
infinite loop.
* pinfo.cc (_pinfo::dup_proc_pipe): Close handle if DuplicateHandle fails and
process no longer exists.
* spawn.cc (spawn_guts): Create process in suspended state if OS demands it.
* wincap.cc: Add "start_proc_suspended" throughout.
* wincap.h (wincaps): Ditto.
(wincapc): Ditto.
This commit is contained in:
Christopher Faylor
2004-12-28 01:27:26 +00:00
parent 432524c162
commit 57ba174fa0
6 changed files with 58 additions and 21 deletions

View File

@@ -128,7 +128,7 @@ _pinfo::exit (UINT n, bool norecord)
}
}
sigproc_printf ("Calling ExitProcess norecord %d, n %d, exitcode %d",
sigproc_printf ("Calling ExitProcess norecord %d, n %p, exitcode %p",
norecord, n, exitcode);
_my_tls.stacklock = 0;
_my_tls.stackptr = _my_tls.stack;
@@ -768,7 +768,11 @@ _pinfo::dup_proc_pipe (HANDLE hProcess)
0, FALSE,
DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE);
if (!res)
sigproc_printf ("DuplicateHandle failed, pid %d, hProcess %p, %E", pid, hProcess);
{
if (WaitForSingleObject (hProcess, 0) == WAIT_OBJECT_0)
CloseHandle (wr_proc_pipe);
sigproc_printf ("DuplicateHandle failed, pid %d, hProcess %p, %E", pid, hProcess);
}
else
{
wr_proc_pipe_owner = dwProcessId;