Administrator
2023-09-14 29778778a3b21d77b95ccfe92367d077180e40a3
utils/tool.py
@@ -1,8 +1,10 @@
"""
常用工具
"""
import ctypes
import decimal
import random
import threading
import time
import time as t
import datetime
@@ -234,3 +236,15 @@
        if code in cache_dict:
            return True, cache_dict.get(code)
        return False, None
def get_thread_id():
    try:
        if constant.is_windows():
            return threading.current_thread().ident
        else:
            thread_id = ctypes.CDLL('libc.so.6').syscall(186)  # Linux下的系统调用号
            return thread_id
    except:
        pass
    return None