tool 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tool/thread_local.rb +5 -5
- data/lib/tool/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 957f199ec72715506547dd26a5d290743e92b6de
|
4
|
+
data.tar.gz: 2d398cd3454dffa91ff9d7d2a80f44405be6c197
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfecff9484e4eda3240e1b99395e00683c583c09f0b1e9dc5c533347e422d37204aa3113204c4d804f4d8fa78cc6c5f19756a8e12dca4f7cb59aed047794c38a
|
7
|
+
data.tar.gz: 077654427a1d76b1a889641125aac6b4b6aeb9338fe1cb215f30d8d8ec077b3e07912d7d0570f09482539ad5247e38018584030eac8f3b872387e99175ceaa98
|
data/lib/tool/thread_local.rb
CHANGED
@@ -6,10 +6,10 @@ module Tool
|
|
6
6
|
# Have thread local values without them actually being thread global.
|
7
7
|
#
|
8
8
|
# Advantages:
|
9
|
-
# *
|
10
|
-
# *
|
11
|
-
# *
|
12
|
-
# *
|
9
|
+
# * Values for all threads are garbage collected when ThreadLocal instance is.
|
10
|
+
# * Values for specific thread are garbage collected when thread is.
|
11
|
+
# * No hidden global state.
|
12
|
+
# * Supports other data types besides hashes.
|
13
13
|
#
|
14
14
|
# @example To replace Thread.current hash access
|
15
15
|
# local = Tool::ThreadLocal.new
|
@@ -55,7 +55,7 @@ module Tool
|
|
55
55
|
# @see #initialize
|
56
56
|
# @!visibility private
|
57
57
|
def self.new(*)
|
58
|
-
result = super
|
58
|
+
result = super
|
59
59
|
@mutex.synchronize { @locals << WeakRef.new(result) }
|
60
60
|
result
|
61
61
|
end
|
data/lib/tool/version.rb
CHANGED