Subject: | question / possible bug with Win32::IPC |
Date: | Wed, 4 Jan 2012 14:14:37 -0500 |
To: | bug-Win32-IPC [...] rt.cpan.org |
From: | Cary Lewis <cary.lewis [...] gmail.com> |
I am using Win::IPC via Win::ChangeNotify, and I have noticed that if I
have a signal handler active at the time of doing a wait, then the signal
that is being "handled" is ignored.
The following code demonstrates the issue:
use Win32::ChangeNotify;
$WatchSubTree = 0;
$Events="FILE_NAME";
$notify = Win32::ChangeNotify->new(".", $WatchSubTree, $Events);
$SIG{INT} = sub {print "ok\n";exit;};
print "during this sleep, intr will be caught!\n";
sleep(2);
while(1)
{
print "waiting\n";
$notify->wait();
print "change!\n";
$notify->reset;
}
Once the $notify->wait() call is executed, the $SIG{INT} no longer works,
and furthermore, hitting ctrl-c no longer interrupts the wait.
Without the $SIG{INT} code, ctrl-c does interrupt the wait.
I tried to search for Win32::IPC wait and signal handler - but didn't see
anything relevant, so I hope you don't mind me sending you an email.
BTW, I running this on Windows 7 32bit under Cygwin and I also reproduced
this with the strawberry perl.
Any insight would be most appreciated.