* 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.
This commit is contained in:
parent
c0b813e500
commit
883bbc6478
@ -1,3 +1,16 @@
|
|||||||
|
2002-11-29 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
2002-11-28 Christopher Faylor <cgf@redhat.com>
|
2002-11-28 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
* sigproc.cc (sig_dispatch_pending): Remove assertion.
|
* sigproc.cc (sig_dispatch_pending): Remove assertion.
|
||||||
|
@ -569,6 +569,8 @@ dll_crt0_1 ()
|
|||||||
mainthread.init ("mainthread"); // For use in determining if signals
|
mainthread.init ("mainthread"); // For use in determining if signals
|
||||||
// should be blocked.
|
// should be blocked.
|
||||||
|
|
||||||
|
winpids::init ();
|
||||||
|
|
||||||
int envc = 0;
|
int envc = 0;
|
||||||
char **envp = NULL;
|
char **envp = NULL;
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ fillout_pinfo (pid_t pid, int winpid)
|
|||||||
static unsigned int i;
|
static unsigned int i;
|
||||||
if (!pids.npids || !nextpid)
|
if (!pids.npids || !nextpid)
|
||||||
{
|
{
|
||||||
pids.init (winpid);
|
pids.set (winpid);
|
||||||
i = 0;
|
i = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -613,12 +613,22 @@ winpids::enum9x (bool winpid)
|
|||||||
return nelem;
|
return nelem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NO_COPY CRITICAL_SECTION winpids::cs;
|
||||||
|
|
||||||
void
|
void
|
||||||
winpids::init (bool winpid)
|
winpids::set (bool winpid)
|
||||||
{
|
{
|
||||||
|
EnterCriticalSection (&cs);
|
||||||
npids = (this->*enum_processes) (winpid);
|
npids = (this->*enum_processes) (winpid);
|
||||||
if (pidlist)
|
if (pidlist)
|
||||||
pidlist[npids] = 0;
|
pidlist[npids] = 0;
|
||||||
|
LeaveCriticalSection (&cs);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
winpids::init ()
|
||||||
|
{
|
||||||
|
InitializeCriticalSection (&cs);
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD
|
DWORD
|
||||||
|
@ -203,17 +203,19 @@ class winpids
|
|||||||
DWORD enumNT (bool winpid);
|
DWORD enumNT (bool winpid);
|
||||||
DWORD enum9x (bool winpid);
|
DWORD enum9x (bool winpid);
|
||||||
void add (DWORD& nelem, bool, DWORD pid);
|
void add (DWORD& nelem, bool, DWORD pid);
|
||||||
|
static CRITICAL_SECTION cs;
|
||||||
public:
|
public:
|
||||||
DWORD npids;
|
DWORD npids;
|
||||||
inline void reset () { npids = 0; release (); }
|
inline void reset () { npids = 0; release (); }
|
||||||
void init (bool winpid);
|
void set (bool winpid);
|
||||||
winpids (int): enum_processes (&winpids::enum_init) { reset (); }
|
winpids (int): enum_processes (&winpids::enum_init) { reset (); }
|
||||||
winpids (): pidlist (NULL), npidlist (0), pinfolist (NULL),
|
winpids (): pidlist (NULL), npidlist (0), pinfolist (NULL),
|
||||||
enum_processes (&winpids::enum_init), npids (0) { init (0); }
|
enum_processes (&winpids::enum_init), npids (0) { set (0); }
|
||||||
inline DWORD& winpid (int i) const {return pidlist[i];}
|
inline DWORD& winpid (int i) const {return pidlist[i];}
|
||||||
inline _pinfo *operator [] (int i) const {return (_pinfo *) pinfolist[i];}
|
inline _pinfo *operator [] (int i) const {return (_pinfo *) pinfolist[i];}
|
||||||
~winpids ();
|
~winpids ();
|
||||||
void release ();
|
void release ();
|
||||||
|
static void init ();
|
||||||
};
|
};
|
||||||
|
|
||||||
extern __inline pid_t
|
extern __inline pid_t
|
||||||
|
@ -339,7 +339,7 @@ getsid (pid_t pid)
|
|||||||
extern "C" ssize_t
|
extern "C" ssize_t
|
||||||
read (int fd, void *ptr, size_t len)
|
read (int fd, void *ptr, size_t len)
|
||||||
{
|
{
|
||||||
const struct iovec iov =
|
const iovec iov =
|
||||||
{
|
{
|
||||||
iov_base: ptr,
|
iov_base: ptr,
|
||||||
iov_len: len
|
iov_len: len
|
||||||
|
Loading…
x
Reference in New Issue
Block a user