* dcrt0.cc (dll_crt0_1): Initialize mainthread stuff here before anything needs
it. * sigproc.cc (sigproc_init): Move mainthread initialization out of here. * sigproc.h (sigthread): Add init() method. (sigframe): Don't try to initialize muto. * sync.cc: Undef WaitForSingleObject to avoid recursion.
This commit is contained in:
parent
2dc173fe91
commit
12e659efa8
|
@ -1,3 +1,13 @@
|
||||||
|
Wed May 17 23:13:32 2000 Christopher Faylor <cgf@cygnus.com>
|
||||||
|
|
||||||
|
* dcrt0.cc (dll_crt0_1): Initialize mainthread stuff here before
|
||||||
|
anything needs it.
|
||||||
|
* sigproc.cc (sigproc_init): Move mainthread initialization out of
|
||||||
|
here.
|
||||||
|
* sigproc.h (sigthread): Add init() method.
|
||||||
|
(sigframe): Don't try to initialize muto.
|
||||||
|
* sync.cc: Undef WaitForSingleObject to avoid recursion.
|
||||||
|
|
||||||
2000-05-17 DJ Delorie <dj@cygnus.com>
|
2000-05-17 DJ Delorie <dj@cygnus.com>
|
||||||
|
|
||||||
* testsuite/winsup.api/crlf.c: New
|
* testsuite/winsup.api/crlf.c: New
|
||||||
|
|
|
@ -22,6 +22,8 @@ details. */
|
||||||
HANDLE NO_COPY hMainProc = NULL;
|
HANDLE NO_COPY hMainProc = NULL;
|
||||||
HANDLE NO_COPY hMainThread = NULL;
|
HANDLE NO_COPY hMainThread = NULL;
|
||||||
|
|
||||||
|
sigthread NO_COPY mainthread; // ID of the main thread
|
||||||
|
|
||||||
static NO_COPY char dummy_user_data[sizeof (per_process)] = {0};
|
static NO_COPY char dummy_user_data[sizeof (per_process)] = {0};
|
||||||
per_process NO_COPY *user_data = (per_process *) &dummy_user_data;
|
per_process NO_COPY *user_data = (per_process *) &dummy_user_data;
|
||||||
|
|
||||||
|
@ -624,6 +626,9 @@ dll_crt0_1 ()
|
||||||
or attach to the shared data structure if it's already running. */
|
or attach to the shared data structure if it's already running. */
|
||||||
shared_init ();
|
shared_init ();
|
||||||
|
|
||||||
|
mainthread.init ("mainthread"); // For use in determining if signals
|
||||||
|
// should be blocked.
|
||||||
|
|
||||||
if (mypid)
|
if (mypid)
|
||||||
set_myself (cygwin_shared->p[mypid]);
|
set_myself (cygwin_shared->p[mypid]);
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,6 @@ Static waitq waitq_main; // Storage for main thread
|
||||||
|
|
||||||
muto NO_COPY *sync_proc_subproc = NULL; // Control access to subproc stuff
|
muto NO_COPY *sync_proc_subproc = NULL; // Control access to subproc stuff
|
||||||
|
|
||||||
sigthread NO_COPY mainthread; // ID of the main thread
|
|
||||||
DWORD NO_COPY sigtid = 0; // ID of the signal thread
|
DWORD NO_COPY sigtid = 0; // ID of the signal thread
|
||||||
|
|
||||||
int NO_COPY pending_signals = 0; // TRUE if signals pending
|
int NO_COPY pending_signals = 0; // TRUE if signals pending
|
||||||
|
@ -604,9 +603,6 @@ sigproc_init ()
|
||||||
to a signal handler function. */
|
to a signal handler function. */
|
||||||
signal_arrived = CreateEvent(&sec_none_nih, TRUE, FALSE, NULL);
|
signal_arrived = CreateEvent(&sec_none_nih, TRUE, FALSE, NULL);
|
||||||
|
|
||||||
mainthread.id = GetCurrentThreadId ();// For use in determining if signals
|
|
||||||
// should be blocked.
|
|
||||||
|
|
||||||
if (!(hwait_sig = makethread (wait_sig, NULL, 0, "sig")))
|
if (!(hwait_sig = makethread (wait_sig, NULL, 0, "sig")))
|
||||||
{
|
{
|
||||||
system_printf ("cannot create wait_sig thread, %E");
|
system_printf ("cannot create wait_sig thread, %E");
|
||||||
|
|
|
@ -40,6 +40,11 @@ struct sigthread
|
||||||
DWORD frame;
|
DWORD frame;
|
||||||
muto *lock;
|
muto *lock;
|
||||||
sigthread () : id (0), frame (0), lock (0) {}
|
sigthread () : id (0), frame (0), lock (0) {}
|
||||||
|
void init (const char *s)
|
||||||
|
{
|
||||||
|
lock = new_muto (FALSE, s);
|
||||||
|
id = GetCurrentThreadId ();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class sigframe
|
class sigframe
|
||||||
|
@ -50,8 +55,6 @@ private:
|
||||||
public:
|
public:
|
||||||
void set (sigthread &t, int up = 1)
|
void set (sigthread &t, int up = 1)
|
||||||
{
|
{
|
||||||
if (!t.lock)
|
|
||||||
t.lock = new_muto (FALSE, "sigthread");
|
|
||||||
t.lock->acquire ();
|
t.lock->acquire ();
|
||||||
st = &t;
|
st = &t;
|
||||||
t.frame = (DWORD) (up ? __builtin_frame_address (1) :
|
t.frame = (DWORD) (up ? __builtin_frame_address (1) :
|
||||||
|
|
|
@ -23,6 +23,8 @@ details. */
|
||||||
|
|
||||||
muto NO_COPY muto_start;
|
muto NO_COPY muto_start;
|
||||||
|
|
||||||
|
#undef WaitForSingleObject
|
||||||
|
|
||||||
/* Constructor */
|
/* Constructor */
|
||||||
muto::muto (int inh, const char *s) : sync (0), visits(0), waiters(-1), tid (0), next (NULL)
|
muto::muto (int inh, const char *s) : sync (0), visits(0), waiters(-1), tid (0), next (NULL)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue