From 60cb91c18cf1cf7ea66835d1b8e73cb66ff05ab3 Mon Sep 17 00:00:00 2001 From: Chewing_Bever Date: Wed, 14 Dec 2022 17:23:51 +0100 Subject: [PATCH] chore: final read before merging --- src/build/queue.v | 4 +++- src/server/server.v | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/build/queue.v b/src/build/queue.v index 5d50f34b..79021730 100644 --- a/src/build/queue.v +++ b/src/build/queue.v @@ -144,7 +144,9 @@ fn (mut q BuildJobQueue) pop_invalid(arch string) { // peek shows the first job for the given architecture that's ready to be // executed, if present. pub fn (mut q BuildJobQueue) peek(arch string) ?BuildJob { - rlock q.mutex { + // Even peek requires a write lock, because pop_invalid can modify the data + // structure + lock q.mutex { if arch !in q.queues { return none } diff --git a/src/server/server.v b/src/server/server.v index 6d18f094..74b1f377 100644 --- a/src/server/server.v +++ b/src/server/server.v @@ -36,9 +36,7 @@ fn (mut app App) init_job_queue() ! { for targets.len > 0 { for target in targets { - for arch in target.arch { - app.job_queue.insert(target: target, arch: arch.value)! - } + app.job_queue.insert_all(target)! } i += 25