chore: 代码格式优化

This commit is contained in:
Rock Chin
2023-03-16 20:22:18 +08:00
parent 3aca987176
commit d1549b3df0
3 changed files with 29 additions and 18 deletions

View File

@@ -1,4 +1,6 @@
import threading
from pkg.utils import ThreadCtl
context = {
'inst': {
@@ -78,14 +80,15 @@ def get_plugin_host():
context_lock.release()
return t
def set_thread_ctl(inst):
context_lock.acquire()
context['pool_ctl'] = inst
context_lock.release()
from pkg.utils import ThreadCtl
def get_thread_ctl() -> ThreadCtl:
context_lock.acquire()
t = context['pool_ctl']
t: ThreadCtl = context['pool_ctl']
context_lock.release()
return t
return t