Skip to content

Commit 7ac9ac3

Browse files
authored
Revert "Make Distributed.Worker threadsafe (#37905)" (#38112)
This reverts commit 444aa87.
1 parent d288ad8 commit 7ac9ac3

File tree

3 files changed

+4
-59
lines changed

3 files changed

+4
-59
lines changed

stdlib/Distributed/src/cluster.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ mutable struct Worker
9999
add_msgs::Array{Any,1}
100100
gcflag::Bool
101101
state::WorkerState
102-
c_state::Event # wait for state changes
102+
c_state::Condition # wait for state changes
103103
ct_time::Float64 # creation time
104104
conn_func::Any # used to setup connections lazily
105105

@@ -133,7 +133,7 @@ mutable struct Worker
133133
if haskey(map_pid_wrkr, id)
134134
return map_pid_wrkr[id]
135135
end
136-
w=new(id, [], [], false, W_CREATED, Event(), time(), conn_func)
136+
w=new(id, [], [], false, W_CREATED, Condition(), time(), conn_func)
137137
w.initialized = Event()
138138
register_worker(w)
139139
w
@@ -144,7 +144,7 @@ end
144144

145145
function set_worker_state(w, state)
146146
w.state = state
147-
notify(w.c_state)
147+
notify(w.c_state; all=true)
148148
end
149149

150150
function check_worker_state(w::Worker)
@@ -189,7 +189,7 @@ function wait_for_conn(w)
189189
timeout = worker_timeout() - (time() - w.ct_time)
190190
timeout <= 0 && error("peer $(w.id) has not connected to $(myid())")
191191

192-
@async (sleep(timeout); notify(w.c_state))
192+
@async (sleep(timeout); notify(w.c_state; all=true))
193193
wait(w.c_state)
194194
w.state === W_CREATED && error("peer $(w.id) didn't connect to $(myid()) within $timeout seconds")
195195
end

stdlib/Distributed/test/distributed_exec.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1711,5 +1711,4 @@ include("splitrange.jl")
17111711
# Run topology tests last after removing all workers, since a given
17121712
# cluster at any time only supports a single topology.
17131713
rmprocs(workers())
1714-
include("threads.jl")
17151714
include("topology.jl")

stdlib/Distributed/test/threads.jl

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)