futex 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/futex.gemspec +1 -1
  3. data/lib/futex.rb +5 -5
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 729dc25954a8a169668ca2d458d24156c8b4d2555a5945714ededf99fadad3fe
4
- data.tar.gz: 82fb28cad4a9ad74152ebb4e5160971a66d14b0897c952297a69868ee2b0a067
3
+ metadata.gz: 8425c8a24f6fccfcf6c2e46f8b09948e29f01c7c7ee2268b5f6624cef1a5ae4d
4
+ data.tar.gz: b0b18b16071c6605f20b7363ff7c716187db97f204bb66c9708d99f0498a8b18
5
5
  SHA512:
6
- metadata.gz: 43337117eab085f589235a636f33fc801a27b21378011ff199a805fd213f9df7a5c6c2e90467290547184f0777ecc58a3c2a77a06c5d562f7d4eae1f62dacf4d
7
- data.tar.gz: 024ddc3edc4bcf35beb17f468867d8f9d4feccf1214e8ba4f05f3c9718770653edf70fc8060f47c0ddb9637241e3a837915e6ea926d6e5b669f8d3082f6adec9
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.1'
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})")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: futex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko