mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
disable Toontown's cheesy lock for normal, threaded Panda
This commit is contained in:
parent
211df4b90f
commit
ea05496d09
@ -7,15 +7,20 @@ from PythonUtil import *
|
|||||||
from direct.directnotify import DirectNotifyGlobal
|
from direct.directnotify import DirectNotifyGlobal
|
||||||
import types
|
import types
|
||||||
|
|
||||||
# This one line will replace the cheesy hack below, when we remove the
|
from libpandaexpress import ConfigVariableBool
|
||||||
# hack.
|
|
||||||
#from direct.stdpy.threading import Lock
|
|
||||||
|
|
||||||
|
# If using the Toontown ActiveX launcher, this must be set true.
|
||||||
|
# Also, Panda must be compiled with SIMPLE_THREADS or no HAVE_THREADS
|
||||||
|
# at all. In the normal Panda case, this should be set false.
|
||||||
|
if ConfigVariableBool('delay-messenger-lock', False).getValue():
|
||||||
class Lock:
|
class Lock:
|
||||||
""" This is a cheesy delayed implementation of Lock, designed to
|
""" This is a cheesy delayed implementation of Lock, designed to
|
||||||
support the Toontown ActiveX launch, which must import Messenger
|
support the Toontown ActiveX launch, which must import Messenger
|
||||||
before it has downloaded the rest of Panda. This is a TEMPORARY
|
before it has downloaded the rest of Panda. Note that this
|
||||||
HACK, to be removed when the ActiveX launch is retired. """
|
cheesy lock isn't thread-safe if the application starts any
|
||||||
|
threads before acquiring the Messenger lock the first time.
|
||||||
|
(However, it's mostly thread-safe if Panda is compiled with
|
||||||
|
SIMPLE_THREADS.) """
|
||||||
|
|
||||||
notify = DirectNotifyGlobal.directNotify.newCategory("Messenger.Lock")
|
notify = DirectNotifyGlobal.directNotify.newCategory("Messenger.Lock")
|
||||||
|
|
||||||
@ -69,7 +74,11 @@ class Lock:
|
|||||||
self.notify.info("Got cheesy lock.")
|
self.notify.info("Got cheesy lock.")
|
||||||
|
|
||||||
# We return with the lock acquired.
|
# We return with the lock acquired.
|
||||||
|
else:
|
||||||
|
# In the normal case, there's no reason not to import all of
|
||||||
|
# libpanda right away, and so we can just use Lock directly. This
|
||||||
|
# is perfectly thread-safe.
|
||||||
|
from direct.stdpy.threading import Lock
|
||||||
|
|
||||||
class Messenger:
|
class Messenger:
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user