Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Ensure no thruption is delivered until restarts are available.

Borrow appropriate check from David Lichteblau's commit in mainline.

* src/compiler/generic/parms.lisp (*common-static-symbols*): added *restart-clusters*
* src/runtime/thread.c (create_thread_struct): bind *restart-clusters*
(thread_may_interrupt): check *restart-clusters*
  • Loading branch information...
commit 78b43e6379ea462224f411d6c6e507f8439d5d36 1 parent ac12a95
@akovalenko authored
Showing with 10 additions and 0 deletions.
  1. +1 −0  src/compiler/generic/parms.lisp
  2. +9 −0 src/runtime/thread.c
View
1  src/compiler/generic/parms.lisp
@@ -81,6 +81,7 @@
sb!unix::*allow-with-interrupts*
sb!unix::*interrupts-enabled*
sb!unix::*interrupt-pending*
+ #!+sb-thruption sb!impl::*restart-clusters*
*in-without-gcing*
*gc-inhibit*
*gc-pending*
View
9 src/runtime/thread.c
@@ -875,6 +875,7 @@ create_thread_struct(lispobj initial_function) {
#if defined(LISP_FEATURE_WIN32) && defined(LISP_FEATURE_SB_THREAD)
bind_variable(GC_SAFE,NIL,th);
bind_variable(IN_SAFEPOINT,NIL,th);
+ bind_variable(RESTART_CLUSTERS,NIL,th);
bind_variable(DISABLE_SAFEPOINTS,NIL,th);
#endif
@@ -1068,6 +1069,14 @@ static inline int thread_may_interrupt()
// 2) INTERRUPTS_ENABLED is not-nil
// 3) !pseudo_atomic (now guaranteed by safepoint-related callers)
+ // borrowed from David Lichteblau's commit in main branch
+ if (SymbolValue(RESTART_CLUSTERS, self) == NIL)
+ /* This special case prevents TERMINATE-THREAD from hitting
+ * during INITIAL-THREAD-FUNCTION before it's ready. Curiously,
+ * deferrables are already unblocked there. Further
+ * investigation may be in order. */
+ return 0;
+
if (SymbolValue(INTERRUPTS_ENABLED, self) == NIL)
return 0;
Please sign in to comment.
Something went wrong with that request. Please try again.