File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -103,13 +103,13 @@ def run(self):
103103 try :
104104 work_item = self ._work_queue .get (block = True , timeout = self ._keep_alive_time )
105105 except queue .Empty :
106- if self . _executor . _free_thread_count > self . _executor . _min_workers :
107- # Got lock problem here , may cause dead lock slightly chance , don't know how to fix it.
108- self ._executor ._adjust_free_thread_count ( - 1 )
109- self ._executor ._remove_thread ( self )
110- break
111- else :
112- continue
106+ # Got lock problem here , may cause dead lock slightly chance , don't know how to fix it.
107+ with self . _executor_free_thread_count_lock :
108+ if self ._executor ._free_thread_count > self . _executor . _min_workers :
109+ self ._executor ._free_thread_count -= 1
110+ break
111+ else :
112+ continue
113113
114114 if work_item is not None :
115115 self ._executor ._adjust_free_thread_count (- 1 )
You can’t perform that action at this time.
0 commit comments