From 55afbd0a66b922701ed1bc16d8d0ba3d15613e91 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sun, 4 Aug 2024 14:12:04 -0700 Subject: [PATCH] In URI#freeze, synchronize mutex before checking for frozen? This was a race condition. --- lib/rdf/model/uri.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rdf/model/uri.rb b/lib/rdf/model/uri.rb index deeb4ffc..1ebf5e5c 100644 --- a/lib/rdf/model/uri.rb +++ b/lib/rdf/model/uri.rb @@ -716,8 +716,8 @@ def dup ## # @private def freeze - unless frozen? - @mutex.synchronize do + @mutex.synchronize do + unless frozen? # Create derived components authority; userinfo; user; password; host; port @value = value.freeze