Skip to content

Commit 63c8445

Browse files
vtjnashKristofferC
authored andcommitted
fix Event to use normal Condition variable (#55441)
ThreadSynchronizer is only for things that are very trivial, as there are a lot of things they are forbidden from doing (such as waiting for a Task to set it). Happened to notice while reviewing #55439 (review) that this was still using the pre-v1.2 style lock, which makes this mostly useless in v1.4+ (cherry picked from commit 2a4e2b1)
1 parent 89faa35 commit 63c8445

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

base/lock.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,10 +498,10 @@ This provides an acquire & release memory ordering on notify/wait.
498498
The `autoreset` functionality and memory ordering guarantee requires at least Julia 1.8.
499499
"""
500500
mutable struct Event
501-
const notify::ThreadSynchronizer
501+
const notify::Threads.Condition
502502
const autoreset::Bool
503503
@atomic set::Bool
504-
Event(autoreset::Bool=false) = new(ThreadSynchronizer(), autoreset, false)
504+
Event(autoreset::Bool=false) = new(Threads.Condition(), autoreset, false)
505505
end
506506

507507
function wait(e::Event)

0 commit comments

Comments
 (0)