Skip to content

Commit

Permalink
fix Event to use normal Condition variable (JuliaLang#55441)
Browse files Browse the repository at this point in the history
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
JuliaLang#55439 (review)
that this was still using the pre-v1.2 style lock, which makes this
mostly useless in v1.4+
  • Loading branch information
vtjnash authored and lazarusA committed Aug 17, 2024
1 parent 5c9a444 commit d700526
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/lock.jl
Original file line number Diff line number Diff line change
Expand Up @@ -498,10 +498,10 @@ This provides an acquire & release memory ordering on notify/wait.
The `autoreset` functionality and memory ordering guarantee requires at least Julia 1.8.
"""
mutable struct Event
const notify::ThreadSynchronizer
const notify::Threads.Condition
const autoreset::Bool
@atomic set::Bool
Event(autoreset::Bool=false) = new(ThreadSynchronizer(), autoreset, false)
Event(autoreset::Bool=false) = new(Threads.Condition(), autoreset, false)
end

function wait(e::Event)
Expand Down

0 comments on commit d700526

Please sign in to comment.