* 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:
@@ -83,6 +83,22 @@ int kill_pgrp (pid_t, siginfo_t&);
|
||||
void __reg1 exit_thread (DWORD) __attribute__ ((noreturn));
|
||||
void __reg1 setup_signal_exit (int);
|
||||
|
||||
class no_thread_exit_protect
|
||||
{
|
||||
static bool flag;
|
||||
bool modify;
|
||||
public:
|
||||
no_thread_exit_protect (int) {flag = true; modify = true;}
|
||||
~no_thread_exit_protect ()
|
||||
{
|
||||
if (modify)
|
||||
flag = false;
|
||||
}
|
||||
no_thread_exit_protect () {modify = false;}
|
||||
operator int () {return flag;}
|
||||
};
|
||||
|
||||
|
||||
extern "C" void sigdelayed ();
|
||||
|
||||
extern char myself_nowait_dummy[];
|
||||
|
Reference in New Issue
Block a user