aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/pinfo.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-11-29 07:05:26 +0000
committerChristopher Faylor <me@cgf.cx>2002-11-29 07:05:26 +0000
commit883bbc647820b396ff6929ae4d3cda329981a093 (patch)
tree9870d78924f4df51a52be1100d9ec93c938417f3 /winsup/cygwin/pinfo.cc
parentc0b813e5003809f9d93e3e1b646cb6c9114fe364 (diff)
downloadnewlib-883bbc647820b396ff6929ae4d3cda329981a093.zip
newlib-883bbc647820b396ff6929ae4d3cda329981a093.tar.gz
newlib-883bbc647820b396ff6929ae4d3cda329981a093.tar.bz2
* pinfo.h (winpids::set): Renamed from init.
(winpids::init): New declaration. (winpids::cs): Ditto. (winpids::winpids): Use set rather than init. * external.cc (fillout_pinfo): Ditto. * dcrt0.cc (dll_crt0_1): Call winpids::init. * pinfo.cc (winpids::set): Renamed from init. Wrap calls in critical section. (winpids::init): New function. (winpids::cs): Define.
Diffstat (limited to 'winsup/cygwin/pinfo.cc')
-rw-r--r--winsup/cygwin/pinfo.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index 6feea64..75b71f2 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -613,12 +613,22 @@ winpids::enum9x (bool winpid)
return nelem;
}
+NO_COPY CRITICAL_SECTION winpids::cs;
+
void
-winpids::init (bool winpid)
+winpids::set (bool winpid)
{
+ EnterCriticalSection (&cs);
npids = (this->*enum_processes) (winpid);
if (pidlist)
pidlist[npids] = 0;
+ LeaveCriticalSection (&cs);
+}
+
+void
+winpids::init ()
+{
+ InitializeCriticalSection (&cs);
}
DWORD