Skip to content

Commit 3622e17

Browse files
timholyvtjnash
andauthored
Apply suggestions from code review
Co-authored-by: Jameson Nash <[email protected]>
1 parent 44d2eeb commit 3622e17

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

SnoopCompileCore/src/snoop_inference.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const snoop_inference_lock = ReentrantLock()
44
const newly_inferred = CodeInstance[]
55

66
function start_tracking()
7-
islocked(snoop_inference_lock) && error("already tracking inference (cannot nest `@snoop_inference` blocks)")
7+
snoop_inference_lock.reentrancy_cnt == 1 || throw(ConcurrencyViolationError("already tracking inference (cannot nest `@snoop_inference` blocks)"))
88
lock(snoop_inference_lock)
99
empty!(newly_inferred)
1010
ccall(:jl_set_newly_inferred, Cvoid, (Any,), newly_inferred)
@@ -15,7 +15,7 @@ function start_tracking()
1515
end
1616

1717
function stop_tracking()
18-
@assert islocked(snoop_inference_lock)
18+
Base.assert_havelock(snoop_inference_lock)
1919
ccall(:jl_set_newly_inferred, Cvoid, (Any,), nothing)
2020
unlock(snoop_inference_lock)
2121
# ccall(:jl_log_dispatch_backtrace, Any, (Cint,), 0)

0 commit comments

Comments
 (0)