delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/04/04/03:20:26

From: sos AT prospect DOT com DOT ru (Sergey Okhapkin)
Subject: Any ideas? (Was: Signal handling)
4 Apr 1997 03:20:26 -0800 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <01BC40E8.2EB00850.cygnus.gnu-win32@gater.krystalbank.msk.ru>
Original-To: "'Gnu-Win32'" <gnu-win32 AT cygnus DOT com>
Encoding: 28 TEXT
Original-Sender: owner-gnu-win32 AT cygnus DOT com

Hi!

In brief, signal handling in cygwin.dll does the following:

signal arrived (in separate signal processing thread);
if(signal masked or ignored)
  return;
if(signal handler == SIG_DFL)
  exit process;
suspend main thread;
save IP of main thread;
set main thread IP to signal handler address;
resume main thread;
exit signal thread;
when signal handler exits, restore original IP;

This scheme has one misfeature - signal handler will not start immediately 
if main thread is in a blocking Win32 syscall (WaitForMultipleObjects(), 
ReadConsoleInput() etc), but when this syscall terminates. This misfeature 
brokes signal semantic. We can't start signal handler in a context of 
signal processing thread, because this handler may never return (longjmp() 
from within signal handler is allowed). Any ideas are welcome...

--
Sergey Okhapkin
Moscow, Russia
Looking for a job.


-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019