Skip to content

Commit

Permalink
Swap Base.Event to use a ThreadSynchronizer (JuliaLang#51093)
Browse files Browse the repository at this point in the history
and make some of its other fields const.
  • Loading branch information
gbaraldi authored Aug 31, 2023
1 parent 6f026e3 commit e3e1f1e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions base/lock.jl
Original file line number Diff line number Diff line change
Expand Up @@ -435,10 +435,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
notify::Threads.Condition
autoreset::Bool
const notify::ThreadSynchronizer
const autoreset::Bool
@atomic set::Bool
Event(autoreset::Bool=false) = new(Threads.Condition(), autoreset, false)
Event(autoreset::Bool=false) = new(ThreadSynchronizer(), autoreset, false)
end

function wait(e::Event)
Expand Down

0 comments on commit e3e1f1e

Please sign in to comment.