Skip to content

Commit

Permalink
fixup! Use Threads.Condition instead of Event
Browse files Browse the repository at this point in the history
  • Loading branch information
vchuravy committed Nov 12, 2020
1 parent d641bef commit 3b00732
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions stdlib/Distributed/src/cluster.jl
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,7 @@ function wait_for_conn(w)
@async begin
sleep(timeout)
lock(w.c_state) do
# TODO: This can wakeup other listeners, who might be fine waiting longer
# or who are waiting for a different state change.
# Note: This could wakeup other listeners on `c_state`
notify(w.c_state; all=true)
end
end
Expand Down Expand Up @@ -643,10 +642,7 @@ function create_worker(manager, wconfig)
lock(jw.c_state) do
wait(jw.c_state)
end
# Failed to connect
if jw.state === W_CREATED
continue
end
# Note: jw.state could still be in W_CREATED if we got woke to early,
end
push!(join_list, jw)
end
Expand Down Expand Up @@ -675,10 +671,7 @@ function create_worker(manager, wconfig)
lock(wl.c_state) do
wait(wl.c_state)
end
# Failed to connect
if wl.state === W_CREATED
continue
end
# Note: wl.state could still be in W_CREATED if we got woke to early,
end
push!(join_list, wl)
end
Expand Down

0 comments on commit 3b00732

Please sign in to comment.