e-threadpool 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/threadpool/core.rb +5 -1
- metadata +1 -1
data/lib/threadpool/core.rb
CHANGED
@@ -43,6 +43,10 @@ module Ethreadpool
|
|
43
43
|
@checker_thread.join
|
44
44
|
end
|
45
45
|
|
46
|
+
def busy_workers_count
|
47
|
+
busy_workers.count
|
48
|
+
end
|
49
|
+
|
46
50
|
private
|
47
51
|
def run_checker
|
48
52
|
loop do
|
@@ -59,7 +63,7 @@ module Ethreadpool
|
|
59
63
|
end
|
60
64
|
sleep(0.001)
|
61
65
|
|
62
|
-
if @teminate &&
|
66
|
+
if @teminate && busy_workers_count == 0
|
63
67
|
return
|
64
68
|
end
|
65
69
|
end
|