Skip to content

Commit e3e1f1e

Browse files
authored
Swap Base.Event to use a ThreadSynchronizer (#51093)
and make some of its other fields const.
1 parent 6f026e3 commit e3e1f1e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

base/lock.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -435,10 +435,10 @@ This provides an acquire & release memory ordering on notify/wait.
435435
The `autoreset` functionality and memory ordering guarantee requires at least Julia 1.8.
436436
"""
437437
mutable struct Event
438-
notify::Threads.Condition
439-
autoreset::Bool
438+
const notify::ThreadSynchronizer
439+
const autoreset::Bool
440440
@atomic set::Bool
441-
Event(autoreset::Bool=false) = new(Threads.Condition(), autoreset, false)
441+
Event(autoreset::Bool=false) = new(ThreadSynchronizer(), autoreset, false)
442442
end
443443

444444
function wait(e::Event)

0 commit comments

Comments
 (0)