Commit b8df7a77 authored by Marius Gerbershagen's avatar Marius Gerbershagen
Browse files

cmp: execute cleanup forms of unwind-protect with interrupts disabled

    Unifies behaviour with ECL_UNWIND_PROTECT.
parent 55d6367b
......@@ -77,6 +77,8 @@ in C code
- No more explicit option in ~main.d~ to trap SIGCHLD asynchronously
- Zombie processes are cleaned in ~external-process~ finalizer. If process
is still referenced in the memory, it's programmer duty to call wait.
- The cleanup forms of an unwind-protect are now executed with interrupts
disabled.
* 16.1.3 changes since 16.1.2
** Announcement
Dear Community,
......
......@@ -87,14 +87,20 @@
(*destination* 'VALUES))
(c2expr* form))
(wt-nl "}")
;; Here we disable interrupts for the execution of the cleanup forms...
(wt-nl "ecl_bds_bind(cl_env_copy,ECL_INTERRUPTS_ENABLED,ECL_NIL);")
(wt-nl "ecl_frs_pop(cl_env_copy);")
;; Here we save the values of the form which might have been
;; aborted, and execute some cleanup code. This code may also
;; be aborted by some control structure, but is not protected.
;; aborted, and execute some cleanup code. This code may also be
;; aborted by some control structure, it is only protected against
;; interrupts from other threads.
(wt-nl nargs "=ecl_stack_push_values(cl_env_copy);")
(let ((*destination* 'TRASH))
(c2expr* body))
(wt-nl "ecl_stack_pop_values(cl_env_copy," nargs ");")
;; ...and here we reenable the interrupts.
(wt-nl "ecl_bds_unwind1(cl_env_copy);")
(wt-nl "ecl_check_pending_interrupts(cl_env_copy);")
;; Finally, if the protected form was aborted, jump to the
;; next catch point...
(wt-nl "if (unwinding) ecl_unwind(cl_env_copy,next_fr);")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment