pipa-threadpool 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -1
- data/lib/threadpool.rb +4 -4
- metadata +2 -2
data/README.rdoc
CHANGED
data/lib/threadpool.rb
CHANGED
@@ -79,11 +79,11 @@ class ThreadPool
|
|
79
79
|
end if block_given?
|
80
80
|
end
|
81
81
|
|
82
|
-
#
|
82
|
+
# alive? => boolean
|
83
83
|
#
|
84
84
|
# Pool is live when it's not dead.
|
85
85
|
# Pool is dead when it's closed.
|
86
|
-
def
|
86
|
+
def alive?
|
87
87
|
synchronize { !@dead }
|
88
88
|
end
|
89
89
|
|
@@ -111,7 +111,7 @@ class ThreadPool
|
|
111
111
|
#
|
112
112
|
# === Example:
|
113
113
|
# puts 'zomg' unless pool.try_run('go to hell') {|greeting| puts greeting }
|
114
|
-
def
|
114
|
+
def run?(*args, &block)
|
115
115
|
run_core(false, *args, &block)
|
116
116
|
end
|
117
117
|
|
@@ -185,7 +185,7 @@ class ThreadPool
|
|
185
185
|
job.run rescue nil
|
186
186
|
end
|
187
187
|
ensure
|
188
|
-
synchronize { @workers.delete(Thread.current) }
|
188
|
+
synchronize { @workers.delete(Thread.current) unless @dead }
|
189
189
|
end
|
190
190
|
end
|
191
191
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pipa-threadpool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Igor Gunko
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-06-
|
12
|
+
date: 2009-06-12 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|