Fix race condition while iterating over clients
This commit is contained in:
@@ -13,6 +13,13 @@ from objects import osuToken
|
||||
class tokenList:
|
||||
def __init__(self):
|
||||
self.tokens = {}
|
||||
self._lock = threading.Lock()
|
||||
|
||||
def __enter__(self):
|
||||
self._lock.acquire()
|
||||
|
||||
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||
self._lock.release()
|
||||
|
||||
def addToken(self, userID, ip = "", irc = False, timeOffset=0, tournament=False):
|
||||
"""
|
||||
|
Reference in New Issue
Block a user