Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add way to print where lock conflicts are
  • Loading branch information
IanButterworth committed Jul 14, 2024
commit 1543d06bd8b6bfb99fe534975b9d5c1f3fd80bdc
9 changes: 9 additions & 0 deletions base/lock.jl
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ end
return false
end

const TRACE_LOCK_CONFLICTS = Ref{Bool}(false)

"""
lock(lock)

Expand All @@ -160,6 +162,13 @@ Each `lock` must be matched by an [`unlock`](@ref).
finally
unlock(c.lock)
end
if TRACE_LOCK_CONFLICTS[]
try
error()
catch
println("lock conflict", sprint(show_backtrace, catch_backtrace()))
end
end
end)(rl)
return
end
Expand Down