Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-03-07 09:19:34 +0300
committerChristopher Faylor <me@cgf.cx>2001-03-07 09:19:34 +0300
commitefd76e4140cbdb4e1f6acfbf5c95e5bf6e5dceeb (patch)
treec4d56fa1118655ddf32c9e0beaacd23524787670 /winsup/cygwin/sigproc.h
parent25ee9ae28513c5cee6ade2c1cdc12984c8639491 (diff)
* 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.
Diffstat (limited to 'winsup/cygwin/sigproc.h')
-rw-r--r--winsup/cygwin/sigproc.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/winsup/cygwin/sigproc.h b/winsup/cygwin/sigproc.h
index a5b72bca2..0daa493f5 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;
}