Initial YakPanel commit

This commit is contained in:
Niranjan
2026-04-07 02:04:22 +05:30
commit 2826d3e7f3
5359 changed files with 1390724 additions and 0 deletions

27
class/public/gcmanager.py Normal file
View File

@@ -0,0 +1,27 @@
from .acquire import acquire
import threading
import gc
_GC_DISABLE_COUNT = 0
_GC_DISABLE_COUNT_LOCK = threading.Lock()
# 停用GC
def gc_disable():
with acquire(_GC_DISABLE_COUNT_LOCK, timeout=1):
global _GC_DISABLE_COUNT
_GC_DISABLE_COUNT += 1
if _GC_DISABLE_COUNT > 1:
return
gc.disable()
# 启用GC
def gc_enable():
with acquire(_GC_DISABLE_COUNT_LOCK, timeout=1):
global _GC_DISABLE_COUNT
_GC_DISABLE_COUNT -= 1
if _GC_DISABLE_COUNT > 0:
return
gc.enable()