* 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>
|
||||
|
||||
* sigproc.cc (sig_dispatch_pending): Remove assertion.
|
||||
|
|
|
@ -569,6 +569,8 @@ dll_crt0_1 ()
|
|||
mainthread.init ("mainthread"); // For use in determining if signals
|
||||
// should be blocked.
|
||||
|
||||
winpids::init ();
|
||||
|
||||
int envc = 0;
|
||||
char **envp = NULL;
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ fillout_pinfo (pid_t pid, int winpid)
|
|||
static unsigned int i;
|
||||
if (!pids.npids || !nextpid)
|
||||
{
|
||||
pids.init (winpid);
|
||||
pids.set (winpid);
|
||||
i = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -203,17 +203,19 @@ class winpids
|
|||
DWORD enumNT (bool winpid);
|
||||
DWORD enum9x (bool winpid);
|
||||
void add (DWORD& nelem, bool, DWORD pid);
|
||||
static CRITICAL_SECTION cs;
|
||||
public:
|
||||
DWORD npids;
|
||||
inline void reset () { npids = 0; release (); }
|
||||
void init (bool winpid);
|
||||
void set (bool winpid);
|
||||
winpids (int): enum_processes (&winpids::enum_init) { reset (); }
|
||||
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 _pinfo *operator [] (int i) const {return (_pinfo *) pinfolist[i];}
|
||||
~winpids ();
|
||||
void release ();
|
||||
static void init ();
|
||||
};
|
||||
|
||||
extern __inline pid_t
|
||||
|
|
|
@ -339,7 +339,7 @@ getsid (pid_t pid)
|
|||
extern "C" ssize_t
|
||||
read (int fd, void *ptr, size_t len)
|
||||
{
|
||||
const struct iovec iov =
|
||||
const iovec iov =
|
||||
{
|
||||
iov_base: ptr,
|
||||
iov_len: len
|
||||
|
|
Loading…
Reference in New Issue