direct.stdpy.thread
from direct.stdpy.thread import LockType, allocate_lock, exit, get_ident, interrupt_main, stack_size, start_new_thread
This module reimplements Python’s native thread module using Panda threading constructs. It’s designed as a drop-in replacement for the thread module for code that works with Panda; it is necessary because in some compilation models, Panda’s threading constructs are incompatible with the OS-provided threads used by Python’s thread module.
Inheritance diagram
- class LockType[source]
Bases:
object
Implements a mutex lock. Instead of directly subclassing PandaModules.Mutex, we reimplement the lock here, to allow us to provide the described Python lock semantics. In particular, this allows a different thread to release the lock than the one that acquired it.
- considerYield()
C++ Interface: consider_yield()
- /**
Possibly suspends the current thread for the rest of the current epoch, if
it has run for enough this epoch. This is especially important for the
simple thread implementation, which relies on cooperative yields like this.
*/
- consider_yield()
C++ Interface: consider_yield()
- /**
Possibly suspends the current thread for the rest of the current epoch, if
it has run for enough this epoch. This is especially important for the
simple thread implementation, which relies on cooperative yields like this.
*/
- forceYield()
C++ Interface: force_yield()
- /**
Suspends the current thread for the rest of the current epoch.
*/