futex 0.8.0 → 0.8.1
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 +1 -1
- data/test/test_futex.rb +6 -0
- 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: d8a8d71051dbbfbccbf315a3ff9db4a8412d254a6f2076a759c5cc0ed27f1e34
|
4
|
+
data.tar.gz: 6f89829eb5326e4152c8422e8d5057c4c54c9e74cab0593c959d52aa2ef76b1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 379a44ca71ef3e5e76f92a89ee5a702177c4561e3c251a973caed8958182656bca60b469d46642f0cd753a9047b9daf96b43e759705f06af737141a97948011a
|
7
|
+
data.tar.gz: e50ddd647eb79bd744a5f382be7600cff51779d6392feb699cc308bf59c1a67779a04675bf863f8d5bd70ded46835c9bfdc8300a95ba21e53c6c2c35176ac09f
|
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.8.
|
34
|
+
s.version = '0.8.1'
|
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
@@ -121,7 +121,7 @@ access to #{@path}, #{age(start)} already: #{IO.read(@lock)} \
|
|
121
121
|
#{@path} (attempt no.#{cycle})")
|
122
122
|
File.write(@lock, b)
|
123
123
|
acq = Time.now
|
124
|
-
res = yield(@path)
|
124
|
+
res = block_given? ? yield(@path) : nil
|
125
125
|
debug("Unlocked by #{b} in #{age(acq)}, #{prefix}exclusive: #{@path}")
|
126
126
|
res
|
127
127
|
end
|
data/test/test_futex.rb
CHANGED