threadlock 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/threadlock.rb +3 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9e468f9ee53ba62c0e93e867676cd0b221333065
4
- data.tar.gz: 64dd811925f0137922f72f2a1c6021a25d8ed0b7
3
+ metadata.gz: 690971678359590f806de448665ace8c671cbdf4
4
+ data.tar.gz: 976a934e2288dd3dbcdcba57eef942914b5c9de7
5
5
  SHA512:
6
- metadata.gz: f85ac803a6a94032f89163c06bf0b926c059dc36272c0fb6de843f01730d3f26237674b16ab5da5b50b87d9553179a73919ae55311f5c143c79fe53522ca5fdc
7
- data.tar.gz: 48e1909828e0a6aeff375d9ccc89774e0015d55b2ed55941bbbc4b97da55ac422fd3799e657dd97aed86e626dc30137d67af931edb2bd999681dbb1717ef27ca
6
+ metadata.gz: ef1086f8452e7d52aed6c386ff39f04d9cc87c2aaa0aceca48f83c3fa8337a1bff2e407717c7d7169060a8f91a5f14f6f137ef09c683bd8fac0b2553798c7fcb
7
+ data.tar.gz: c2f5a307cecf7b83bf00a616527de51833ba22c417d2b4f113a7adff227adbed58d2259e6313aa99b7136a39e1129b582f2908b27f6f5c534e7a9e7ce1f2109e
data/lib/threadlock.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'monitor'
2
2
 
3
- def threadlock(*funcs)
3
+ def threadlock(*funcs, lock: :@___threadlock___)
4
4
  for f in funcs.flatten
5
5
  f2 = f.to_s
6
6
  .gsub(/\=/, "_eQUAL")
@@ -19,8 +19,8 @@ def threadlock(*funcs)
19
19
  ("
20
20
  alias :#{f2} :#{f}
21
21
  def #{f}(*args)
22
- @___threadlock___ ||= Monitor.new
23
- @___threadlock___.synchronize do
22
+ #{lock.to_s} ||= Monitor.new
23
+ #{lock.to_s}.synchronize do
24
24
  #{f2}(*args)
25
25
  end
26
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: threadlock
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe McIlvain
@@ -50,5 +50,5 @@ rubyforge_project:
50
50
  rubygems_version: 2.0.2
51
51
  signing_key:
52
52
  specification_version: 4
53
- summary: threadlock
53
+ summary: 'threadlock: Easy, featherweight thread protection for basic ruby objects.'
54
54
  test_files: []