From 9736595c7b49c8f9d38e3119c9f4f9425c83e169 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Tue, 1 Jun 2021 10:32:36 -0600 Subject: [PATCH] cs: avoid promoting unknown OS thread to known Related to changes in 18a95c3ae6, but shouldn't affect the problem that commit addressed, since Racket-level callbacks need to be involved. --- racket/src/cs/rumble/foreign.ss | 2 +- racket/src/cs/rumble/virtual-register.ss | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/racket/src/cs/rumble/foreign.ss b/racket/src/cs/rumble/foreign.ss index 8e827ca072..98a8bf2143 100644 --- a/racket/src/cs/rumble/foreign.ss +++ b/racket/src/cs/rumble/foreign.ss @@ -1768,7 +1768,7 @@ (loop (cdr types) (cons (ctype-host-rep type) reps) decls)))]))) ;; Rely on the fact that a virtual register defaults to 0 to detect a -;; thread that we didn't start. For a thread that we did start, a +;; thread that we didn't start. (define PLACE-UNKNOWN-THREAD 0) (define PLACE-KNOWN-THREAD 1) (define PLACE-MAIN-THREAD 2) diff --git a/racket/src/cs/rumble/virtual-register.ss b/racket/src/cs/rumble/virtual-register.ss index 060b50e690..bde83d3bfb 100644 --- a/racket/src/cs/rumble/virtual-register.ss +++ b/racket/src/cs/rumble/virtual-register.ss @@ -44,4 +44,6 @@ ;; foreign thread that has not yet been initialized to run Rumble ;; and later layers: (when (eq? 0 (current-future)) - (init-virtual-registers))) + (init-virtual-registers) + ;; set `place-thread-category` back to "unknown": + (place-thread-category PLACE-UNKNOWN-THREAD)))