B #1941: ActionManager threads counter not decreased

This commit is contained in:
Vlastimil Holer authored and Ruben S. Montero committed 2018-04-06 15:42:12 +02:00
1 parent 1013195609
commit aaa488fefa
1 file changed
+9 -7
+9 -7
View File
@@ -196,14 +196,16 @@ class ActionManager
if action[:threaded]
thread = Thread.new {
action[:method].call(*action[:args])
begin
action[:method].call(*action[:args])
ensure
@threads_mutex.synchronize {
@num_running -= 1
delete_running_action(action[:id])
@threads_mutex.synchronize {
@num_running -= 1
delete_running_action(action[:id])
@threads_cond.signal
}
@threads_cond.signal
}
end
}
action[:thread] = thread