From efd76e4140cbdb4e1f6acfbf5c95e5bf6e5dceeb Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 7 Mar 2001 06:19:34 +0000 Subject: * sigproc.h (sigthread): Declare new methods. Create new winapi_lock field. (sigframe:;set): Call get_winapi_lock after frame is set so that signal handler thread knows not to call SuspendThread. (sigframe::~sigframe): Release winapi_lock. * exceptions.cc (sigthread::get_winapi_lock): New method. (sigthread::release_winapi_lock): New method. (setup_handler): Use get_winapi_lock to ensure that signalled thread is not blocked in a Windows API. * path.h (path_types): Avoid broken GCC warning. --- winsup/cygwin/sigproc.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'winsup/cygwin/sigproc.h') diff --git a/winsup/cygwin/sigproc.h b/winsup/cygwin/sigproc.h index a5b72bc..0daa493 100644 --- a/winsup/cygwin/sigproc.h +++ b/winsup/cygwin/sigproc.h @@ -40,6 +40,9 @@ struct sigthread DWORD id; DWORD frame; CRITICAL_SECTION lock; + LONG winapi_lock; + bool get_winapi_lock (int test = 0); + void release_winapi_lock (); void init (const char *s); }; @@ -51,8 +54,11 @@ private: public: void set (sigthread &t, DWORD ebp) { + DWORD oframe = t.frame; st = &t; t.frame = ebp; + if (!oframe) + t.get_winapi_lock (); } sigframe () {st = NULL;} @@ -69,6 +75,7 @@ public: { EnterCriticalSection (&st->lock); st->frame = 0; + st->release_winapi_lock (); LeaveCriticalSection (&st->lock); st = NULL; } -- cgit v1.1