Sketched better handling of self-inflicted SIGs

This commit is contained in:
Thomas Schmitt 2007-01-11 13:34:41 +00:00
parent 1455fe33be
commit 1af888d9d5
2 changed files with 32 additions and 2 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2007.01.11.131302"
#define Cdrskin_timestamP "2007.01.11.131615"

View File

@ -209,8 +209,38 @@ ex:
int burn_builtin_abort_handler(void *handle, int signum, int flag)
{
if(getpid() != abort_control_pid)
if(getpid() != abort_control_pid) {
#ifdef Not_yeT
pthread_t thread_id;
/* >>> need better handling of self-induced SIGs
like SIGSEGV or SIGFPE.
Like bonking the control thread if it did not show up
after a short while.
*/
/* >>> if this is a non-fatal signal : return -2 */
thread_id = pthread_self();
/* >>> find thread_id in worker list of async.c */
/* >>> if owning a drive : mark idle and canceled
(can't do anything more) */
usleep(1000000); /* calm down */
/* forward signal to control thread */
if (abort_control_pid>1)
kill(abort_control_pid, signum);
/* >>> ??? end thread */;
#else
usleep(1000000); /* calm down */
return -2;
#endif /* ! Not_yeT */
}
Cleanup_set_handlers(NULL, NULL, 2);
fprintf(stderr,"%sABORT : Trying to shut down drive and library\n",
abort_message_prefix);