Skip to content

Commit ab74d8a

Browse files
authored
Merge pull request SAML-Toolkits#342 from karupanerura/fixed-mutex
Correct the usage of Mutex
2 parents 55359e2 + ef7d890 commit ab74d8a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/onelogin/ruby-saml/saml_message.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ class SamlMessage
2121

2222
BASE64_FORMAT = %r(\A[A-Za-z0-9+/]{4}*[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=?\Z)
2323

24+
@@mutex = Mutex.new
25+
2426
# @return [Nokogiri::XML::Schema] Gets the schema object of the SAML 2.0 Protocol schema
2527
#
2628
def self.schema
27-
Mutex.new.synchronize do
29+
@@mutex.synchronize do
2830
Dir.chdir(File.expand_path("../../../schemas", __FILE__)) do
2931
::Nokogiri::XML::Schema(File.read("saml-schema-protocol-2.0.xsd"))
3032
end

0 commit comments

Comments
 (0)