* sigproc.h (no_thread_exit_protect): New class.
* sigproc.cc (thread_exit): Use no_thread_exit_protect to determine if we need to coordinate ThreadExit/ExitProcess. * fhandler_dsp.cc (fhandler_dev_dsp::Audio_out::stop): Use no_thread_exit_protect to kludge around waiting for waveOutClose as it waits for a thread that never exits. (fhandler_dev_dsp::Audio_in::stop): Ditto for waveInClose. * fhandler.h (fhandler_dev_dsp::base): New method. (fhandler_dev_dsp::_read): Ditto. (fhandler_dev_dsp::_write): Ditto. (fhandler_dev_dsp::_ioctl): Ditto. (fhandler_dev_dsp::_fixup_after_fork): Ditto. (fhandler_dev_dsp::_fixup_after_exec): Ditto. * fhandler_dsp.cc (fhandler_dev_dsp::read): Call real function via base() pointer. (fhandler_dev_dsp::write): Ditto. (fhandler_dev_dsp::ioctl): Ditto. (fhandler_dev_dsp::fixup_after_fork): Ditto. (fhandler_dev_dsp::fixup_after_exec): Ditto. (fhandler_dev_dsp::_read): Rename by adding an leading underscore. (fhandler_dev_dsp::_write): Ditto. (fhandler_dev_dsp::_ioctl): Ditto. (fhandler_dev_dsp::_fixup_after_fork): Ditto. (fhandler_dev_dsp::_fixup_after_exec): Ditto.
This commit is contained in:
@@ -39,6 +39,8 @@ struct sigaction *global_sigs;
|
||||
const char *__sp_fn ;
|
||||
int __sp_ln;
|
||||
|
||||
bool no_thread_exit_protect::flag;
|
||||
|
||||
char NO_COPY myself_nowait_dummy[1] = {'0'};// Flag to sig_send that signal goes to
|
||||
// current process but no wait is required
|
||||
|
||||
@@ -446,6 +448,8 @@ void
|
||||
exit_thread (DWORD res)
|
||||
{
|
||||
# undef ExitThread
|
||||
if (no_thread_exit_protect ())
|
||||
ExitThread (res);
|
||||
sigfillset (&_my_tls.sigmask); /* No signals wanted */
|
||||
lock_process for_now; /* May block indefinitely when exiting. */
|
||||
HANDLE h;
|
||||
@@ -465,7 +469,7 @@ exit_thread (DWORD res)
|
||||
siginfo_t si = {__SIGTHREADEXIT, SI_KERNEL};
|
||||
si.si_cyg = h;
|
||||
sig_send (myself_nowait, si, &_my_tls);
|
||||
ExitThread (0);
|
||||
ExitThread (res);
|
||||
}
|
||||
|
||||
int __reg3
|
||||
|
Reference in New Issue
Block a user