mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
add forceYield(), considerYield() at this level too
This commit is contained in:
parent
9dad929019
commit
f582d8f950
@ -11,11 +11,17 @@ __all__ = [
|
|||||||
'interrupt_main',
|
'interrupt_main',
|
||||||
'exit', 'allocate_lock', 'get_ident',
|
'exit', 'allocate_lock', 'get_ident',
|
||||||
'stack_size',
|
'stack_size',
|
||||||
|
'forceYield', 'considerYield',
|
||||||
]
|
]
|
||||||
|
|
||||||
# Import PandaModules as pm, so we don't have any namespace collisions.
|
# Import PandaModules as pm, so we don't have any namespace collisions.
|
||||||
from pandac import PandaModules as pm
|
from pandac import PandaModules as pm
|
||||||
|
|
||||||
|
# These methods are defined in Panda, and are particularly useful if
|
||||||
|
# you may be running in Panda's SIMPLE_THREADS compilation mode.
|
||||||
|
forceYield = pm.Thread.forceYield
|
||||||
|
considerYield = pm.Thread.considerYield
|
||||||
|
|
||||||
class error(StandardError):
|
class error(StandardError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -81,6 +81,12 @@ class ThreadBase:
|
|||||||
else:
|
else:
|
||||||
self.__dict__[key] = value
|
self.__dict__[key] = value
|
||||||
|
|
||||||
|
# Copy these static methods from Panda's Thread object. These are
|
||||||
|
# useful if you may be running in Panda's SIMPLE_THREADS compilation
|
||||||
|
# mode.
|
||||||
|
ThreadBase.forceYield = pm.Thread.forceYield
|
||||||
|
ThreadBase.considerYield = pm.Thread.considerYield
|
||||||
|
|
||||||
class Thread(ThreadBase):
|
class Thread(ThreadBase):
|
||||||
""" This class provides a wrapper around Panda's PythonThread
|
""" This class provides a wrapper around Panda's PythonThread
|
||||||
object. The wrapper is designed to emulate Python's own
|
object. The wrapper is designed to emulate Python's own
|
||||||
|
Loading…
x
Reference in New Issue
Block a user