e-threadpool 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
|