Re: Signal issues.




On Dec 30, 2004, at 4:42 PM, Jan Hudec wrote:

I just ran across an incompatible change in signal handling in perl 5.7.3 and later, that causes problems when the Glib::MainLoop is running. The problem is, that the new signal handling stuff defers execution of the perl hooks until a "safe" place -- which never happens when a Gtk::MainLoop sits in a poll. Please consider adding a custom event handler (the poll is broken by the signal, so it should run) to dispatch these handlers.

I thought i'd made a faq entry about this, but obviously i'm just imagining things again. I've got to stop that. Google says:
http://mail.gnome.org/archives/gtk-perl-list/2004-February/msg00111.html

This problem has existed with all versions of gtk2-perl, because we only work with perl >= 5.8.0.

Here's something from one of my apps that needs to have special SIGINT handling at certain times. It uses a heartbeat timer only when the INT handler is installed, to avoid unnecessary load.

  my $signal_watcher;
  sub set_up_interrupt_handling {
     $SIG{INT} = \&my_special_int_handler;
     $signal_watcher = Glib::Timeout->add (100, sub {TRUE});
  }
  sub tear_down_interrupt_handling {
     delete $SIG{INT};
     Glib::Source->remove ($signal_watcher);
  }


--
Jolt is my co-pilot.
  -- Slogan on a giant paper airplane hung in Lobby 7 at MIT.
     http://hacks.mit.edu/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]