LispWorks User Guide and Reference Manual > 32 The HCL Package

NextPrevUpTopContentsIndex

unwind-protect-blocking-interrupts

Macro
Summary

Does unwind-protect blocking interrupts.

Package

hcl

Signature

unwind-protect-blocking-interrupts protected-form &rest cleanups => results

Arguments

protected-form

A form.

cleanups

Forms.

Values

results

The values of protected-form .

Description

The macro unwind-protect-blocking-interrupts executes protected-form with interrupts blocked. On exit, whether local or not, the cleanups are executed with interrupts blocked.

In compiled code, the macro is equvalent to

(mp:with-interrupts-blocked
 (unwind-protect
     protected-form
   (mp:current-process-block-interrupts)
   cleanup1
 cleanup2
 ..)))

However, in interpreted code the macro is expanded to ensure that the call to (mp:current-process-block-interrupts) actually happens. If the above form is interpreted and protected-form uses current-process-unblock-interrupts, the evaluator may throw (if the process is killed, for example) before calling current-process-unblock-interrupts.

Notes
  1. Both the protected form and the cleanups can block and unblock interrupts using current-process-block-interrupts and current-process-unblock-interrupts. Typically the protected form would set up something and then unblock the interrupts. The cleanups may unblock interrupts if some of the cleanups are essential and others are not.
  2. Blocking interrupts causes the process to not respond to interrupts, including killing. You should make sure that forms which are executed with interrupts blocked do not hang.
See also

current-process-block-interrupts
current-process-unblock-interrupts
unwind-protect-blocking-interrupts-in-cleanups


LispWorks User Guide and Reference Manual - 22 Dec 2009

NextPrevUpTopContentsIndex