Remove _streamLock
This commit is contained in:
parent
e40acd335b
commit
b24b4ee88d
|
@ -88,7 +88,6 @@ class token:
|
||||||
# Locks
|
# Locks
|
||||||
self.processingLock = threading.Lock() # Acquired while there's an incoming packet from this user
|
self.processingLock = threading.Lock() # Acquired while there's an incoming packet from this user
|
||||||
self._bufferLock = threading.Lock() # Acquired while writing to packets buffer
|
self._bufferLock = threading.Lock() # Acquired while writing to packets buffer
|
||||||
self._streamsLock = threading.Lock() # Acquired while joining/leaving streams
|
|
||||||
self._spectatorLock = threading.Lock() # Acquired while starting/stopping spectating
|
self._spectatorLock = threading.Lock() # Acquired while starting/stopping spectating
|
||||||
self._multiplayerLock = threading.Lock()# Acquired while joining/leaving streams
|
self._multiplayerLock = threading.Lock()# Acquired while joining/leaving streams
|
||||||
|
|
||||||
|
@ -511,13 +510,9 @@ class token:
|
||||||
:param name: stream name
|
:param name: stream name
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
try:
|
|
||||||
self._streamsLock.acquire()
|
|
||||||
glob.streams.join(name, token=self.token)
|
glob.streams.join(name, token=self.token)
|
||||||
if name not in self.streams:
|
if name not in self.streams:
|
||||||
self.streams.append(name)
|
self.streams.append(name)
|
||||||
finally:
|
|
||||||
self._streamsLock.release()
|
|
||||||
|
|
||||||
def leaveStream(self, name):
|
def leaveStream(self, name):
|
||||||
"""
|
"""
|
||||||
|
@ -526,13 +521,9 @@ class token:
|
||||||
:param name: stream name
|
:param name: stream name
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
try:
|
|
||||||
self._streamsLock.acquire()
|
|
||||||
glob.streams.leave(name, token=self.token)
|
glob.streams.leave(name, token=self.token)
|
||||||
if name in self.streams:
|
if name in self.streams:
|
||||||
self.streams.remove(name)
|
self.streams.remove(name)
|
||||||
finally:
|
|
||||||
self._streamsLock.release()
|
|
||||||
|
|
||||||
def leaveAllStreams(self):
|
def leaveAllStreams(self):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user