* 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.
This commit is contained in:
Christopher Faylor
2001-03-07 06:19:34 +00:00
parent 25ee9ae285
commit efd76e4140
4 changed files with 49 additions and 3 deletions

View File

@ -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;
}