* sigproc.h (class sigframe): Implement 'unregister()' method.
(sigframe::~sigframe): Use unregister method. (sigframe::call_signal_handler): Declare new method. * exceptions.cc (sigframe::call_signal_handler): New method. Unregisters current sigframe before calling signal handler. (setup_handler): Clear waiting threads prior to arming signal_arrived. * syscalls.cc (_read): Change goto to loop. Recalculate sigframe inside of loop so that constructor is called when appropriate. * wait.cc (wait4): Ditto. * signal.cc: Change "sig" to "signal" in debugging messages throughout. * sigproc.cc: Ditto.
This commit is contained in:
@ -49,6 +49,17 @@ class sigframe
|
||||
{
|
||||
private:
|
||||
sigthread *st;
|
||||
void unregister ()
|
||||
{
|
||||
if (st)
|
||||
{
|
||||
EnterCriticalSection (&st->lock);
|
||||
st->frame = 0;
|
||||
st->release_winapi_lock ();
|
||||
LeaveCriticalSection (&st->lock);
|
||||
st = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
void set (sigthread &t, DWORD ebp)
|
||||
@ -70,15 +81,10 @@ public:
|
||||
}
|
||||
~sigframe ()
|
||||
{
|
||||
if (st)
|
||||
{
|
||||
EnterCriticalSection (&st->lock);
|
||||
st->frame = 0;
|
||||
st->release_winapi_lock ();
|
||||
LeaveCriticalSection (&st->lock);
|
||||
st = NULL;
|
||||
}
|
||||
unregister ();
|
||||
}
|
||||
|
||||
int call_signal_handler ();
|
||||
};
|
||||
|
||||
extern sigthread mainthread;
|
||||
|
Reference in New Issue
Block a user