diff options
author | Christopher Faylor <me@cgf.cx> | 2012-03-17 00:20:29 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2012-03-17 00:20:29 +0400 |
commit | 4aeaedf961029e38cd9c97ac1e32ba91406c9e23 (patch) | |
tree | 88371461329ddcd2c9eac8659dd5d2763da82330 /winsup/cygwin/pinfo.h | |
parent | d3f6480e44081964526de50792c6d28ca2d24580 (diff) |
* fork.cc (lock_signals): Move to sigproc.h.
(lock_pthread): Ditto.
(hold_everything): Ditto.
(frok::parent): Call myself.prefork() just before calling CreateProcess. Call
myself.postfork () on function exit.
* pinfo.cc (pinfo::pending_rd_proc_pipe): Define.
(pinfo::pending_wr_proc_pipe): Ditto.
(_pinfo::dup_proc_pipe): Delete.
(pinfo::wait): Move pipe creation into pinfo::prefork. Set pipe variables from
pending_*.
(_pinfo::sync_proc_pipe): Delete.
(_pinfo::proc_pipe_owner): Ditto.
(pinfo::prefork): Define new function.
(pinfo::postfork): Ditto.
(pinfo::postexec): Ditto.
(_pinfo::alert_parent): Remove obsolete call to sync_proc_pipe.
(_pinfo::dup_proc_pipe): Delete declaration.
(_pinfo::sync_proc_pipe): Ditto.
(pinfo::pending_rd_proc_pipe): Declare.
(pinfo::pending_wr_proc_pipe): Ditto.
(pinfo::prefork): Declare new function.
(pinfo::postfork): Ditto.
(pinfo::postexec): Ditto.
(pinfo::wr_proc_pipe): Define new wrapper function.
* sigproc.h: Include "sync.h". Move locking functions from fork to here.
* spawn.cc (child_info_spawn::worker): Delete now-unneeded requirement to
record orig_wr_proc_pipe. Call hold_everything prior to doing anything. Call
myself.prefork() if spawning. Replace wr_proc_pipe synchronization with call
to myself.postexec(). Call myself.postfork() if not execing.
* sync.h: Replace #ifdef wrapper with "#pragma once".
Diffstat (limited to 'winsup/cygwin/pinfo.h')
-rw-r--r-- | winsup/cygwin/pinfo.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/winsup/cygwin/pinfo.h b/winsup/cygwin/pinfo.h index 551f3f29c..1e514e3c0 100644 --- a/winsup/cygwin/pinfo.h +++ b/winsup/cygwin/pinfo.h @@ -111,8 +111,6 @@ public: char *cwd (size_t &); char *cmdline (size_t &); bool set_ctty (class fhandler_termios *, int); - HANDLE dup_proc_pipe (HANDLE, const char *) __attribute__ ((regparm(3))); - void sync_proc_pipe (); bool alert_parent (char); int __stdcall kill (siginfo_t&) __attribute__ ((regparm (2))); bool __stdcall exists () __attribute__ ((regparm (1))); @@ -124,7 +122,6 @@ public: DWORD exec_dwProcessId; public: HANDLE wr_proc_pipe; - DWORD wr_proc_pipe_owner; friend class pinfo_minimal; }; @@ -150,6 +147,8 @@ class pinfo: public pinfo_minimal { bool destroy; _pinfo *procinfo; + static HANDLE pending_rd_proc_pipe; + static HANDLE pending_wr_proc_pipe; public: bool waiter_ready; class cygthread *wait_thread; @@ -205,10 +204,15 @@ public: return res; } #endif + void prefork (bool = false); + void postfork (); + void postexec (); HANDLE shared_handle () {return h;} void set_acl (); friend class _pinfo; friend class winpids; +private: + HANDLE& wr_proc_pipe() {return procinfo->wr_proc_pipe;} }; #define ISSTATE(p, f) (!!((p)->process_state & f)) |