mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 08:15:18 -04:00
stdpy: Switch from deprecated ConditionVarFull to ConditionVar
This commit is contained in:
parent
0a3733ccb9
commit
8b5fc7d835
@ -216,8 +216,8 @@ class RLock(core.ReMutex):
|
|||||||
core.ReMutex.__init__(self, name)
|
core.ReMutex.__init__(self, name)
|
||||||
|
|
||||||
|
|
||||||
class Condition(core.ConditionVarFull):
|
class Condition(core.ConditionVar):
|
||||||
""" This class provides a wrapper around Panda's ConditionVarFull
|
""" This class provides a wrapper around Panda's ConditionVar
|
||||||
object. The wrapper is designed to emulate Python's own
|
object. The wrapper is designed to emulate Python's own
|
||||||
threading.Condition object. """
|
threading.Condition object. """
|
||||||
|
|
||||||
@ -230,7 +230,7 @@ class Condition(core.ConditionVarFull):
|
|||||||
assert isinstance(lock, Lock)
|
assert isinstance(lock, Lock)
|
||||||
|
|
||||||
self.__lock = lock
|
self.__lock = lock
|
||||||
core.ConditionVarFull.__init__(self, self.__lock)
|
core.ConditionVar.__init__(self, self.__lock)
|
||||||
|
|
||||||
def acquire(self, *args, **kw):
|
def acquire(self, *args, **kw):
|
||||||
return self.__lock.acquire(*args, **kw)
|
return self.__lock.acquire(*args, **kw)
|
||||||
@ -240,12 +240,12 @@ class Condition(core.ConditionVarFull):
|
|||||||
|
|
||||||
def wait(self, timeout = None):
|
def wait(self, timeout = None):
|
||||||
if timeout is None:
|
if timeout is None:
|
||||||
core.ConditionVarFull.wait(self)
|
core.ConditionVar.wait(self)
|
||||||
else:
|
else:
|
||||||
core.ConditionVarFull.wait(self, timeout)
|
core.ConditionVar.wait(self, timeout)
|
||||||
|
|
||||||
def notifyAll(self):
|
def notifyAll(self):
|
||||||
core.ConditionVarFull.notifyAll(self)
|
core.ConditionVar.notifyAll(self)
|
||||||
|
|
||||||
notify_all = notifyAll
|
notify_all = notifyAll
|
||||||
|
|
||||||
@ -295,7 +295,7 @@ class Event:
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.__lock = core.Mutex("Python Event")
|
self.__lock = core.Mutex("Python Event")
|
||||||
self.__cvar = core.ConditionVarFull(self.__lock)
|
self.__cvar = core.ConditionVar(self.__lock)
|
||||||
self.__flag = False
|
self.__flag = False
|
||||||
|
|
||||||
def is_set(self):
|
def is_set(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user