threadlock 1.3.0 → 1.3.1

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 +2 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af828e08328bf0b3a7d811cacae465fd81f9a4ae
4
- data.tar.gz: 3c6da6bc34e39ec90eb92a6cc6b64c688a58d18f
3
+ metadata.gz: 7bf65479043db4fdee700ed4d46fcaa08be8b463
4
+ data.tar.gz: c8e5f1d8aa8c7c057231e6b386ddb44666d99936
5
5
  SHA512:
6
- metadata.gz: 4487deaa6998d99bee44689cd8d0e71c84f45b35e78e98eb1e375f5ec10613ffdb8c3f3c3e9044fadbcc310ba43b18533fe130932b130eedc5b14792c2d13cab
7
- data.tar.gz: 920c155bf9445bfe699562563aa1b61ce25b12f77a5581bfd2927c005c345f379b970d4ff40c5fa6a2843feba5bfa95c882f2e28a8abad0f55bed6d805b0e2ff
6
+ metadata.gz: 60290c01d87a1f99e7efd81f402bf5bd07802a46bc4e219265b1e71fe1c89e598e50af4407c8643b5424b3e240442a08fa8b95237ccf2dde77d0b4e71e08e435
7
+ data.tar.gz: c254e8a7bc7e77361ad4bec9bc2e9b6276ea65024b19f785f6e2e5370059a3d615c71b40d7bdb0e3f42575bb667980cefa13d629f7caf62b39af0946c2d52406
@@ -3,11 +3,11 @@ require 'monitor'
3
3
  def threadlock(*meths, lock: :@___threadlock___)
4
4
  meths.flatten.each do |meth|
5
5
  m = instance_method(meth)
6
- define_method(meth) do |*args|
6
+ define_method(meth) do |*args, &block|
7
7
  (instance_variable_get(lock) or \
8
8
  instance_variable_set(lock, Monitor.new))
9
9
  .synchronize do
10
- m.bind(self).call(*args)
10
+ m.bind(self).call(*args, &block)
11
11
  end
12
12
  end
13
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: threadlock
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe McIlvain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-24 00:00:00.000000000 Z
11
+ date: 2013-09-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'Use the threadlock function in your class definition to automatically
14
14
  run instance methods inside of an instance-wide re-entrant lock (Monitor). All