···436436437437### Bug fixes:
438438439439+- #11800, #12707: fix an assertion race condition in `install_backup_thread`
440440+ (Jan Midtgaard, review by Gabriel Scherer)
441441+439442- #12590, #12595: fix a race in `caml_collect_gc_stats_sample`
440443 (B. Szilvasy, review by Gabriel Scherer)
441444
+6-3
runtime/domain.c
···10421042#endif
1043104310441044 if (di->backup_thread_running == 0) {
10451045- CAMLassert (di->backup_thread_msg == BT_INIT || /* Using fresh domain */
10461046- di->backup_thread_msg == BT_TERMINATE); /* Reusing domain */
10451045+ uintnat msg;
10461046+ msg = atomic_load_acquire(&di->backup_thread_msg);
10471047+ CAMLassert (msg == BT_INIT || /* Using fresh domain */
10481048+ msg == BT_TERMINATE); /* Reusing domain */
1047104910481048- while (atomic_load_acquire(&di->backup_thread_msg) != BT_INIT) {
10501050+ while (msg != BT_INIT) {
10491051 /* Give a chance for backup thread on this domain to terminate */
10501052 caml_plat_unlock (&di->domain_lock);
10511053 cpu_relax ();
10521054 caml_plat_lock (&di->domain_lock);
10551055+ msg = atomic_load_acquire(&di->backup_thread_msg);
10531056 }
1054105710551058#ifndef _WIN32