threadlock 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/threadlock.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bf65479043db4fdee700ed4d46fcaa08be8b463
|
4
|
+
data.tar.gz: c8e5f1d8aa8c7c057231e6b386ddb44666d99936
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60290c01d87a1f99e7efd81f402bf5bd07802a46bc4e219265b1e71fe1c89e598e50af4407c8643b5424b3e240442a08fa8b95237ccf2dde77d0b4e71e08e435
|
7
|
+
data.tar.gz: c254e8a7bc7e77361ad4bec9bc2e9b6276ea65024b19f785f6e2e5370059a3d615c71b40d7bdb0e3f42575bb667980cefa13d629f7caf62b39af0946c2d52406
|
data/lib/threadlock.rb
CHANGED
@@ -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.
|
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-
|
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
|