futex 0.4.1 → 0.4.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 +4 -4
- 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: 7ab0c6b23a6d358ef98795adc73b7b3ec9f9b9b9714dbce423b87a19199f3f00
|
4
|
+
data.tar.gz: 98866fced75a607457dcfa6895f8d0d48f06573d4c6ccb10a806b6d58569ae82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df0638b0dd8f4cebce2ba7b20be4640f211ae2d6e22fb146cd5df1fe3671aa4a5804a6a91240826e4fc9d8a91f46052b30eed12cc8d29a82ce593df13c480acb
|
7
|
+
data.tar.gz: 224cb207f548b50f5ec0226040123dab83b89d003d97cde03dbe6eb2b92fef9c3c671994df43ae328bd3302a59322a849ccbcd84c5aec6b4cc62113656faae35
|
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.4.
|
34
|
+
s.version = '0.4.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
@@ -77,13 +77,13 @@ class Futex
|
|
77
77
|
sleep(@sleep)
|
78
78
|
cycle += 1
|
79
79
|
if Time.now - start > @timeout
|
80
|
-
raise "#{badge} can't get exclusive
|
81
|
-
because of the lock at #{@lock}, after #{age(start)} \
|
80
|
+
raise "#{badge} can't get #{exclusive ? '' : 'non-'}exclusive access \
|
81
|
+
to the file #{@path} because of the lock at #{@lock}, after #{age(start)} \
|
82
82
|
of waiting: #{IO.read(@lock)}"
|
83
83
|
end
|
84
84
|
if (cycle % step).zero? && Time.now - start > @timeout / 2
|
85
|
-
debug("#{badge} still waiting for
|
86
|
-
|
85
|
+
debug("#{badge} still waiting for #{exclusive ? '' : 'non-'}exclusive
|
86
|
+
access to #{@path}, #{age(start)} already: #{IO.read(@lock)}")
|
87
87
|
end
|
88
88
|
end
|
89
89
|
debug("Locked by #{badge} in #{age(start)}: #{@path} \
|