1.0.25.37: block deferrables when gc pending in PA
commitaa0ed5a420ea5295d586b3f323b5375d3b506860
authorGabor Melis <mega@hotpop.com>
Mon, 16 Feb 2009 22:01:15 +0000 (16 22:01 +0000)
committerGabor Melis <mega@hotpop.com>
Mon, 16 Feb 2009 22:01:15 +0000 (16 22:01 +0000)
tree46cba6db81f5c180fac10647822a284dfa77f776
parent8d2697777cef42c9611a015ee13292ca612b8f89
1.0.25.37: block deferrables when gc pending in PA

Consider this:

  set_pseudo_atomic_atomic()
  alloc and set pseudo_atomic_interrupted and GC_PENDING
  clear_pseudo_atomic_atomic()
  if (get_pseudo_atomic_interrupted())
    gc();

If an async interrupt happens and unwinds between
clear_pseudo_atomic_atomic and gc() we have lost a gc trigger until
the next alloc. Same with SIG_STOP_FOR_GC instead of alloc.

This patch addresses the above problem by blocking deferrables when a
gc is requested in a pseudo atomic section. On exit from the protected
section there is no race because no async unwinding interrupts can
happen.
src/runtime/cheneygc.c
src/runtime/gencgc.c
src/runtime/interrupt.c
src/runtime/interrupt.h
src/runtime/thread.c
version.lisp-expr