* 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>
+
+ * 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>
* pinfo.h (_pinfo::getsig): Remove obsolete function, here and
sigset_t sigwait_mask;
siginfo_t *sigwait_info;
siginfo_t infodata;
- void *tid;
+ struct pthread *tid;
struct _threadinfo *prev, *next;
__stack_t stack[8];
int sig;
__attribute__((regparm(3)));
void __stdcall interrupt_setup (int sig, void *handler, struct sigaction& siga, __stack_t retaddr)
__attribute__((regparm(3)));
+ operator HANDLE () const {return tid->win32_obj_id;}
};
#pragma pack(pop)
push (0);
interrupt_setup (sig, handler, siga, (__stack_t) ctx->Eip);
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;
}
}
DWORD res;
- HANDLE hth = myself->getthread2signal ();
+ HANDLE hth = (HANDLE) *tls;
/* 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 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).
-If one of these is activated, then the the signal handler inspects an
-array of integers looking for a non-zero value. The array corresponds
-to the normal UNIX signals + two extra locations for internal usage.
-This array is located in the 'sigtodo' array in the procinfo class.
-
-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.
+Communication on the sendsig pipe is via the 'sigelem' structure. This
+structure is filled out by the sig_send function with information about the
+signal being sent, such as (as of this writing) the signal number, the
+originating pid, the originating thread, and the address of the mask to
+use (this may change).
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
sig_mask = mask;
}
- inline HANDLE getthread2signal ()
- {
- return hMainThread;
- }
-
void commune_recv ();
commune_result commune_send (DWORD, ...);
bool alive ();
#include <sys/signal.h>
#include "cygerrno.h"
#include "sync.h"
-#include "cygtls.h"
-#include "sigproc.h"
#include "pinfo.h"
#include "security.h"
#include "path.h"
#include "dtable.h"
#include "cygheap.h"
#include "child_info_magic.h"
-#include "perthread.h"
#include "shared_info.h"
#include "cygthread.h"
+#include "cygtls.h"
+#include "sigproc.h"
+#include "perthread.h"
/*
* Convenience defines