mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-28 03:27:46 +08:00
* pinfo.h (_pinfo::getthread2signal): Remove obsolete function.
* cygtls.h (_threadinfo): Define tid more precisely. (_threadinfo::operator HANDLE): Define. * exceptions.cc (_threadinfo::interupt_now): Use _threadinfo HANDLE operator to derive thread handle. (setup_handler): Ditto. * sigproc.cc: Reorganize includes.
This commit is contained in:
parent
13584f077b
commit
62e070d72e
@ -1,3 +1,13 @@
|
|||||||
|
2003-11-28 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
|
* pinfo.h (_pinfo::getthread2signal): Remove obsolete function.
|
||||||
|
* cygtls.h (_threadinfo): Define tid more precisely.
|
||||||
|
(_threadinfo::operator HANDLE): Define.
|
||||||
|
* exceptions.cc (_threadinfo::interupt_now): Use _threadinfo HANDLE
|
||||||
|
operator to derive thread handle.
|
||||||
|
(setup_handler): Ditto.
|
||||||
|
* sigproc.cc: Reorganize includes.
|
||||||
|
|
||||||
2003-11-28 Christopher Faylor <cgf@redhat.com>
|
2003-11-28 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
* pinfo.h (_pinfo::getsig): Remove obsolete function, here and
|
* pinfo.h (_pinfo::getsig): Remove obsolete function, here and
|
||||||
|
@ -34,7 +34,7 @@ struct _threadinfo
|
|||||||
sigset_t sigwait_mask;
|
sigset_t sigwait_mask;
|
||||||
siginfo_t *sigwait_info;
|
siginfo_t *sigwait_info;
|
||||||
siginfo_t infodata;
|
siginfo_t infodata;
|
||||||
void *tid;
|
struct pthread *tid;
|
||||||
struct _threadinfo *prev, *next;
|
struct _threadinfo *prev, *next;
|
||||||
__stack_t stack[8];
|
__stack_t stack[8];
|
||||||
int sig;
|
int sig;
|
||||||
@ -51,6 +51,7 @@ struct _threadinfo
|
|||||||
__attribute__((regparm(3)));
|
__attribute__((regparm(3)));
|
||||||
void __stdcall interrupt_setup (int sig, void *handler, struct sigaction& siga, __stack_t retaddr)
|
void __stdcall interrupt_setup (int sig, void *handler, struct sigaction& siga, __stack_t retaddr)
|
||||||
__attribute__((regparm(3)));
|
__attribute__((regparm(3)));
|
||||||
|
operator HANDLE () const {return tid->win32_obj_id;}
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
|
@ -745,7 +745,7 @@ _threadinfo::interrupt_now (CONTEXT *ctx, int sig, void *handler,
|
|||||||
push (0);
|
push (0);
|
||||||
interrupt_setup (sig, handler, siga, (__stack_t) ctx->Eip);
|
interrupt_setup (sig, handler, siga, (__stack_t) ctx->Eip);
|
||||||
ctx->Eip = (DWORD) sigdelayed;
|
ctx->Eip = (DWORD) sigdelayed;
|
||||||
SetThreadContext (myself->getthread2signal (), ctx); /* Restart the thread in a new location */
|
SetThreadContext (*this, ctx); /* Restart the thread in a new location */
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -801,7 +801,7 @@ setup_handler (int sig, void *handler, struct sigaction& siga, _threadinfo *tls)
|
|||||||
}
|
}
|
||||||
|
|
||||||
DWORD res;
|
DWORD res;
|
||||||
HANDLE hth = myself->getthread2signal ();
|
HANDLE hth = (HANDLE) *tls;
|
||||||
|
|
||||||
/* Suspend the thread which will receive the signal. But first ensure that
|
/* Suspend the thread which will receive the signal. But first ensure that
|
||||||
this thread doesn't have any mutos. (FIXME: Someday we should just grab
|
this thread doesn't have any mutos. (FIXME: Someday we should just grab
|
||||||
|
@ -6,17 +6,11 @@ On process startup, cygwin starts a secondary thread that deals with signals.
|
|||||||
This thread contains a loop which blocks waiting for information to show up
|
This thread contains a loop which blocks waiting for information to show up
|
||||||
on a pipe whose handle (sendsig) is currently stored in _pinfo (this may change).
|
on a pipe whose handle (sendsig) is currently stored in _pinfo (this may change).
|
||||||
|
|
||||||
If one of these is activated, then the the signal handler inspects an
|
Communication on the sendsig pipe is via the 'sigelem' structure. This
|
||||||
array of integers looking for a non-zero value. The array corresponds
|
structure is filled out by the sig_send function with information about the
|
||||||
to the normal UNIX signals + two extra locations for internal usage.
|
signal being sent, such as (as of this writing) the signal number, the
|
||||||
This array is located in the 'sigtodo' array in the procinfo class.
|
originating pid, the originating thread, and the address of the mask to
|
||||||
|
use (this may change).
|
||||||
The signal thread uses the InterlockedDecrement function to atomically
|
|
||||||
inspect elements of the array. If one one of the elements of the array
|
|
||||||
is non-zero, then cygwin checks to see if the user has blocked the
|
|
||||||
signal by inspecting the process signal mask. If the signal is blocked,
|
|
||||||
then the current array element is reincremented and the next element is
|
|
||||||
checked.
|
|
||||||
|
|
||||||
If the signal is not blocked, then the function "sig_handle" is called
|
If the signal is not blocked, then the function "sig_handle" is called
|
||||||
with the signal number as an argument. This is a fairly straightforward
|
with the signal number as an argument. This is a fairly straightforward
|
||||||
|
@ -114,11 +114,6 @@ public:
|
|||||||
sig_mask = mask;
|
sig_mask = mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline HANDLE getthread2signal ()
|
|
||||||
{
|
|
||||||
return hMainThread;
|
|
||||||
}
|
|
||||||
|
|
||||||
void commune_recv ();
|
void commune_recv ();
|
||||||
commune_result commune_send (DWORD, ...);
|
commune_result commune_send (DWORD, ...);
|
||||||
bool alive ();
|
bool alive ();
|
||||||
|
@ -20,8 +20,6 @@ details. */
|
|||||||
#include <sys/signal.h>
|
#include <sys/signal.h>
|
||||||
#include "cygerrno.h"
|
#include "cygerrno.h"
|
||||||
#include "sync.h"
|
#include "sync.h"
|
||||||
#include "cygtls.h"
|
|
||||||
#include "sigproc.h"
|
|
||||||
#include "pinfo.h"
|
#include "pinfo.h"
|
||||||
#include "security.h"
|
#include "security.h"
|
||||||
#include "path.h"
|
#include "path.h"
|
||||||
@ -29,9 +27,11 @@ details. */
|
|||||||
#include "dtable.h"
|
#include "dtable.h"
|
||||||
#include "cygheap.h"
|
#include "cygheap.h"
|
||||||
#include "child_info_magic.h"
|
#include "child_info_magic.h"
|
||||||
#include "perthread.h"
|
|
||||||
#include "shared_info.h"
|
#include "shared_info.h"
|
||||||
#include "cygthread.h"
|
#include "cygthread.h"
|
||||||
|
#include "cygtls.h"
|
||||||
|
#include "sigproc.h"
|
||||||
|
#include "perthread.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convenience defines
|
* Convenience defines
|
||||||
|
Loading…
x
Reference in New Issue
Block a user