Skip to content

Commit b686e71

Browse files
authored
[Timing Imports] Use atomic_add! and atomic_sub! (#41737)
1 parent 4f28e6f commit b686e71

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/InteractiveUtils/src/macros.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,10 @@ end
235235
macro time_imports(ex)
236236
quote
237237
try
238-
Base.TIMING_IMPORTS[] += 1
238+
Base.Threads.atomic_add!(Base.TIMING_IMPORTS, 1)
239239
$(esc(ex))
240240
finally
241-
Base.TIMING_IMPORTS[] -= 1
241+
Base.Threads.atomic_sub!(Base.TIMING_IMPORTS, 1)
242242
end
243243
end
244244
end

0 commit comments

Comments
 (0)