Skip to content

Commit 9b90bce

Browse files
committed
Don't lock until capacity is fetched
1 parent ee7b906 commit 9b90bce

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/sch/Sch.jl

+5-2
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,11 @@ function init_proc(state, p)
255255
state.worker_capacity[p.pid][OSProc] = 0
256256
end
257257
cap = remotecall(capacity, p.pid)
258-
@async lock(state.lock) do
259-
state.worker_capacity[p.pid] = fetch(cap)
258+
@async begin
259+
cap = fetch(cap)
260+
lock(state.lock) do
261+
state.worker_capacity[p.pid] = cap
262+
end
260263
end
261264
# TODO: remotecall_fetch(_init_proc, p.pid, state.uid)
262265

0 commit comments

Comments
 (0)