futex 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/futex.gemspec +1 -1
- data/lib/futex.rb +5 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8425c8a24f6fccfcf6c2e46f8b09948e29f01c7c7ee2268b5f6624cef1a5ae4d
|
4
|
+
data.tar.gz: b0b18b16071c6605f20b7363ff7c716187db97f204bb66c9708d99f0498a8b18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12d172ff8c17fe96052e27fd8c9ebe051fd66d7bb7dd6bf8c6f52fd4bc2d5bc4f5fc69d6da55ea9c044ccbb47d451cd12cb627d9db6fb7ab6f54d0ed78e3fd82
|
7
|
+
data.tar.gz: ce255c57a86867e7826e47e1505bdce4c26a0f8b66eeec1356fa6fe7f5831668e4109d6c3bcbe9e72f3b0750da76a1a8b674bf7a550330f1c633b885821a651e
|
data/futex.gemspec
CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
|
|
31
31
|
s.rubygems_version = '2.3.3'
|
32
32
|
s.required_ruby_version = '>=2.3'
|
33
33
|
s.name = 'futex'
|
34
|
-
s.version = '0.6.
|
34
|
+
s.version = '0.6.2'
|
35
35
|
s.license = 'MIT'
|
36
36
|
s.summary = 'File-based mutex'
|
37
37
|
s.description = 'Ruby Gem for file-based locking'
|
data/lib/futex.rb
CHANGED
@@ -87,12 +87,12 @@ class Futex
|
|
87
87
|
if Time.now - start > @timeout
|
88
88
|
raise "#{b} can't get #{prefix}exclusive access \
|
89
89
|
to the file #{@path} because of the lock at #{@lock}, after #{age(start)} \
|
90
|
-
of waiting: #{IO.read(@lock)}"
|
91
|
-
end
|
92
|
-
if (cycle % step).zero? && Time.now - start > @timeout / 2
|
93
|
-
debug("#{b} still waiting for #{prefix}exclusive
|
94
|
-
access to #{@path}, #{age(start)} already: #{IO.read(@lock)}")
|
90
|
+
of waiting: #{IO.read(@lock)} (modified #{age(File.mtime(@lock))} ago)"
|
95
91
|
end
|
92
|
+
next unless (cycle % step).zero? && Time.now - start > @timeout / 2
|
93
|
+
debug("#{b} still waiting for #{prefix}exclusive \
|
94
|
+
access to #{@path}, #{age(start)} already: #{IO.read(@lock)} \
|
95
|
+
(modified #{age(File.mtime(@lock))} ago)")
|
96
96
|
end
|
97
97
|
debug("Locked by #{b} in #{age(start)}, #{prefix}exclusive: \
|
98
98
|
#{@path} (attempt no.#{cycle})")
|