direct.stdpy.threading2

from direct.stdpy.threading2 import Thread, BoundedSemaphore, Condition, Event, RLock, Semaphore, Timer, active_count, current_thread, enumerate, main_thread, setprofile, settrace

This module reimplements Python’s native threading module using Panda threading constructs. It’s designed as a drop-in replacement for the threading 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.

Unlike threading.py, this module is a more explicit implementation of Python’s threading model, designed to more precisely emulate Python’s standard threading semantics. In fact, this is a bald-face copy of Python’s threading module from Python 2.5, with a few lines at the top to import Panda’s thread reimplementation instead of the system thread module, and so it is therefore layered on top of Panda’s thread implementation.

Inheritance diagram

Inheritance diagram of direct.stdpy.threading2

BoundedSemaphore(*args, **kwargs)[source]
Condition(*args, **kwargs)[source]
Event(*args, **kwargs)[source]
RLock(*args, **kwargs)[source]
Semaphore(*args, **kwargs)[source]
class Thread(group=None, target=None, name=None, args=(), kwargs=None, verbose=None, daemon=None)[source]

Bases: _Verbose

__init__(self, group=None, target=None, name=None, args=(), kwargs=None, verbose=None, daemon=None)[source]
property daemon
getName(self)[source]
isDaemon(self)[source]
is_alive(self)[source]
join(self, timeout=None)[source]
property name
run(self)[source]
setDaemon(self, daemonic)[source]
setName(self, name)[source]
start(self)[source]
Timer(*args, **kwargs)[source]
active_count()[source]
current_thread()[source]
enumerate()[source]
main_thread()[source]

Return the main thread object. In normal conditions, the main thread is the thread from which the Python interpreter was started.

setprofile(func)[source]
settrace(func)[source]