Lines Matching refs:sig_on

12 * Use :ref:`sig_on() and sig_off() <section_sig_on>` if you are calling external
16 The functions ``sig_check()``, ``sig_on()`` and ``sig_off()`` can be put in all
45 ``sig_on()`` inside such a function, otherwise you will see a message like
56 ``sig_check()``, the next ``sig_on()`` or possibly the next Python statement.
97 Using ``sig_on()`` and ``sig_off()``
100 Another mechanism for interrupt handling is the pair of functions ``sig_on()``
102 dangerous. You should put ``sig_on()`` *before* and ``sig_off()`` *after* any
104 called in **pairs**, i.e. every ``sig_on()`` must be matched by a closing
109 from cysignals.signals cimport sig_on, sig_off
112 sig_on()
118 It is possible to put ``sig_on()`` and ``sig_off()`` in different functions,
120 ``sig_on()`` returns. The reason is that ``sig_on()`` is implemented using
127 sig_on()
135 from cysignals.signals cimport sig_on, sig_off
142 sig_on()
154 The code inside ``sig_on()`` should be pure C or Cython code. If you call
159 Also, when an interrupt occurs inside ``sig_on()``, code execution
161 inside ``sig_on()`` is lost. See :ref:`advanced-sig` for ways to deal with
164 When the user presses ``CTRL-C`` inside ``sig_on()``, execution will jump back
165 to ``sig_on()`` (the first one if there is a stack) and ``sig_on()`` will raise
169 from cysignals.signals cimport sig_on, sig_off
172 sig_on() # This must be INSIDE the try
178 It is possible to stack ``sig_on()`` and ``sig_off()``. If you do this, the
179 effect is exactly the same as if only the outer ``sig_on()``/``sig_off()`` was
181 nothing. Make sure that the number of ``sig_on()`` calls equal the number of
184 from cysignals.signals cimport sig_on, sig_off
187 sig_on()
192 sig_on()
197 Extra care must be taken with exceptions raised inside ``sig_on()``. The problem
202 from cysignals.signals cimport sig_on, sig_off
204 sig_on()
216 from cysignals.signals cimport sig_on, sig_off
218 sig_on() # This must be OUTSIDE the try
227 from cysignals.signals cimport sig_on, sig_off
230 sig_on()
238 ``sig_on()`` is implemented using the C library call ``setjmp()`` which takes a
240 can conditionally call ``sig_on()`` and ``sig_off()``::
242 from cysignals.signals cimport sig_on, sig_off
245 sig_on()
251 the code inside the ``sig_on()`` block take very little time.