Panda3D

Loading...
Searching...
No Matches
Classes | Functions | Variables
direct.stdpy.thread Namespace Reference

## Classes
class | _local
class | error
class | LockType

## Functions
| _add_thread (thread, wrapper)
| _get_thread_locals (thread, i)
| _get_thread_wrapper (thread, wrapperClass)
| _newname (template="Thread-%d")
| _remove_thread_id (threadId)
| allocate_lock ()
| exit ()
| get_ident ()
| interrupt_main ()
| stack_size (size=0)
| start_new_thread (function, args, kwargs={}, name=None)

## Variables
int | _counter = 0
int | _nextThreadId = 0
dict | _threads = {}
| _threadsLock = core.Mutex('thread._threadsLock')
| consider_yield = core.Thread.consider_yield
| considerYield = consider_yield
| error = RuntimeError
| force_yield = core.Thread.force_yield
| forceYield = force_yield
| TIMEOUT_MAX = float(0xffffffff // 1000)

## Detailed Description

     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.

## Function Documentation

## ◆ _add_thread()

_add_thread | ( |  | thread,
|  |  | wrapper )
| protected

     Adds the indicated core.Thread object, with the indicated Python
    wrapper, to the thread list.  Returns the new thread ID.

## ◆ _get_thread_locals()

_get_thread_locals | ( |  | thread,
|  |  | i )
| protected

     Returns the locals dictionary for the indicated thread.  If
    there is not one, creates an empty dictionary.

## ◆ _get_thread_wrapper()

_get_thread_wrapper | ( |  | thread,
|  |  | wrapperClass )
| protected

     Returns the thread wrapper for the indicated thread.  If there
    is not one, creates an instance of the indicated wrapperClass
    instead.

## ◆ _newname()

_newname | ( |  | template = "Thread-%d" | ) |
| protected

## ◆ _remove_thread_id()

_remove_thread_id | ( |  | threadId | ) |
| protected

     Removes the thread with the indicated ID from the thread list.

## ◆ allocate_lock()

allocate_lock | ( |  | ) |

## ◆ exit()

exit | ( |  | ) |

## ◆ get_ident()

get_ident | ( |  | ) |

## ◆ interrupt_main()

interrupt_main | ( |  | ) |

## ◆ stack_size()

stack_size | ( |  | size = 0 | ) |

## ◆ start_new_thread()

start_new_thread | ( |  | function,
|  |  | args,
|  |  | kwargs = {},
|  |  | name = None )

## Variable Documentation

## ◆ _counter

int _counter = 0
| protected

## ◆ _nextThreadId

int _nextThreadId = 0
| protected

## ◆ _threads

dict _threads = {}
| protected

## ◆ _threadsLock

_threadsLock = core.Mutex('thread._threadsLock')
| protected

## ◆ consider_yield

consider_yield = core.Thread.consider_yield

## ◆ considerYield

considerYield = consider_yield

## ◆ error

error = RuntimeError

## ◆ force_yield

force_yield = core.Thread.force_yield

## ◆ forceYield

forceYield = force_yield

## ◆ TIMEOUT_MAX

TIMEOUT_MAX = float(0xffffffff // 1000)