From dc29ac64a203a954161026ad5f6288df201e11ad Mon Sep 17 00:00:00 2001 From: Onur Gündüz Date: Wed, 24 Jun 2026 02:29:52 +0200 Subject: server: fix tokenizer data race under concurrency --- tools/server/schedule.c | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'tools/server/schedule.c') diff --git a/tools/server/schedule.c b/tools/server/schedule.c index 8fb4231..13e5dc7 100644 --- a/tools/server/schedule.c +++ b/tools/server/schedule.c @@ -182,17 +182,6 @@ int worker_has_pending_jobs(http_server *s) { return pending; } -/* True when work is already queued anywhere ahead of the worker (untokenized or - * tokenized). dispatch routes a new request to the tokenizer thread when this - * holds, so tokenization overlaps in-flight work; an otherwise idle pipeline - * tokenizes the request inline on the worker and skips the queue hand-off. */ -int server_has_backlog(http_server *s) { - pthread_mutex_lock(&s->mu); - int busy = s->raw_head != NULL || s->job_head != NULL; - pthread_mutex_unlock(&s->mu); - return busy; -} - void enqueue_job(job *j) { http_server *s = j->srv; pthread_mutex_lock(&s->mu); -- cgit v1.3.1