1Glib::Signal(3) User Contributed Perl Documentation Glib::Signal(3)
2
3
4
6 Glib::Signal - Object customization and general purpose notification
7
9 This page describes some functions related to signals in Glib. Since
10 most things you can do with signals are tied to Glib::Object instances,
11 the majority of the signal functions are documented there.
12
13 Thread safety
14 Some libraries, most notably GStreamer, sometimes invoke signal
15 handlers from a foreign thread that has no Perl interpreter associated
16 with it. When this happens, we have no choice but to hand the
17 marshalling over to the main loop which in turn later wakes up the main
18 thread and lets it handle the request. We cannot invoke the signal
19 handler from the foreign thread since the Perl interpreter may not be
20 used concurrently.
21
22 The downside to this approach is that the foreign thread is blocked
23 until the main thread has finished executing the signal handler. This
24 might lead to deadlocks. It might help in this case to wrap the
25 crucial parts of the signal handler inside a Glib::Idle callback so
26 that the signal handler can return directly.
27
29 integer = Glib->install_exception_handler ($func, $data=undef)
30 • $func (subroutine)
31
32 • $data (scalar)
33
34 Install a subroutine to be executed when a signal emission traps an
35 exception (a croak or die). $func should return boolean (true if the
36 handler should remain installed) and expect to receive a single scalar.
37 This scalar will be a private copy of $@ which the handler can mangle
38 to its heart's content.
39
40 Returns an identifier that may be used with "remove_exception_handler".
41
42 See "gperl_install_exception_handler()" in Glib::xsapi.
43
44 Glib->remove_exception_handler ($tag)
45 • $tag (integer)
46
47 Remove the exception handler identified by $tag, as returned by
48 "install_exception_handler". If $tag cannot be found, this does
49 nothing.
50
51 WARNING: Do not call this function from within an exception handler.
52 If you want to remove your handler during its execution just have it
53 return false.
54
55 See "gperl_remove_exception_handler()" in Glib::xsapi.
56
58 flags Glib::SignalFlags
59 • 'run-first' / 'G_SIGNAL_RUN_FIRST'
60
61 • 'run-last' / 'G_SIGNAL_RUN_LAST'
62
63 • 'run-cleanup' / 'G_SIGNAL_RUN_CLEANUP'
64
65 • 'no-recurse' / 'G_SIGNAL_NO_RECURSE'
66
67 • 'detailed' / 'G_SIGNAL_DETAILED'
68
69 • 'action' / 'G_SIGNAL_ACTION'
70
71 • 'no-hooks' / 'G_SIGNAL_NO_HOOKS'
72
74 Glib, Glib::Object
75
77 Copyright (C) 2003-2011 by the gtk2-perl team.
78
79 This software is licensed under the LGPL. See Glib for a full notice.
80
81
82
83perl v5.36.0 2022-07-22 Glib::Signal(3)