thread 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/thread/future.rb +12 -2
- data/lib/thread/pool.rb +1 -1
- data/thread.gemspec +1 -1
- 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: 9872e276bf4a9eafda05c16259f2e25d938e78f7
|
4
|
+
data.tar.gz: 2b14d91995e1ff8826e3bd1ae7c8722f4b3d60eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1241c434a0131b2de037f087c36071ceb0976444573a08d387bf7dea05673a4a2032bbf6b61aa3c3a8bfcf8b0ccb394416cab861579b4483be087603e822bd4
|
7
|
+
data.tar.gz: ed31bed39a59921df6503fbfb49f56e4ada4050b5f012a8ffabde883b215701ce91422f1644f0706a4adb61eafabec1c0aabf62c625fa583d66164f97081ad62
|
data/lib/thread/future.rb
CHANGED
@@ -42,7 +42,11 @@ class Thread::Future
|
|
42
42
|
def self.finalizer(thread)
|
43
43
|
proc {
|
44
44
|
if thread.weakref_alive?
|
45
|
-
thread.
|
45
|
+
if thread.is_a? Thread
|
46
|
+
thread.raise Cancel
|
47
|
+
else
|
48
|
+
thread.terminate! Cancel
|
49
|
+
end
|
46
50
|
end
|
47
51
|
}
|
48
52
|
end
|
@@ -75,7 +79,13 @@ class Thread::Future
|
|
75
79
|
return self if delivered?
|
76
80
|
|
77
81
|
@mutex.synchronize {
|
78
|
-
@thread.
|
82
|
+
if @thread.is_a? Thread
|
83
|
+
@thread.raise Cancel
|
84
|
+
else
|
85
|
+
@thread.terminate! Cancel
|
86
|
+
end
|
87
|
+
|
88
|
+
@exception = Cancel.new
|
79
89
|
}
|
80
90
|
|
81
91
|
self
|
data/lib/thread/pool.rb
CHANGED
data/thread.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "thread"
|
7
|
-
spec.version = "0.2.
|
7
|
+
spec.version = "0.2.2"
|
8
8
|
spec.authors = ["meh."]
|
9
9
|
spec.email = ["meh@schizofreni.co"]
|
10
10
|
spec.summary = %q{Various extensions to the base thread library.}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thread
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- meh.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|