摘要: 创建单例模式 import threading import time class Singleton: instance = None # 加锁是为了当多线程调用时,防止出现多线程执行太快都去新建了一个对象,这就违背了单例模式的意义 lock = threading.RLock() def __i 阅读全文
posted @ 2023-12-06 15:07 PiggThird 阅读(5) 评论(0) 推荐(0)