feat: add sel_alloc_thread_id ownership check in eval_select and gc_sweep (6-10)

This commit is contained in:
Rongsong Shen 2026-04-30 06:04:21 +00:00
parent 742d79ee55
commit b722e5cb3d
4 changed files with 59 additions and 0 deletions

View file

@ -10,6 +10,7 @@
#include "scheduler.h"
#include "resreq.h"
#include "utils.h"
extern int scheduler_req_handler(xce_request_t*, void*);
@ -118,6 +119,14 @@ int main(int argc, char* argv[])
while (1) {
sched_update(&sched);
/* Register this thread as the sole eval/GC allocator thread (write-once) */
static int sel_thread_registered = 0;
if (!sel_thread_registered) {
sel_register_alloc_thread();
sel_thread_registered = 1;
}
sched_begin_session(&sched);
sched_go(&sched);