Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
threading Namespace Reference

Data Structures

class  _Verbose
 
class  _RLock
 
class  _Condition
 
class  _Semaphore
 
class  _BoundedSemaphore
 
class  _Event
 
class  Thread
 
class  _Timer
 
class  _MainThread
 
class  _DummyThread
 

Functions

def RLock
 
def Condition
 
def Semaphore
 
def BoundedSemaphore
 
def Event
 
def Timer
 
def currentThread
 
def activeCount
 
def enumerate
 

Variables

 _sys = sys
 
 _time = time.time
 
 _sleep = time.sleep
 
 _start_new_thread = thread.start_new_thread
 
 _allocate_lock = thread.allocate_lock
 
 _get_ident = thread.get_ident
 
 ThreadError = thread.error
 
 _print_exc = traceback.print_exc
 
 _StringIO = StringIO.StringIO
 
int _VERBOSE = 0
 
 Lock = _allocate_lock
 
int _counter = 0
 
tuple _active_limbo_lock = _allocate_lock()
 
dictionary _active = {}
 
dictionary _limbo = {}
 
 mon
 
 rc
 
 wc
 
 limit
 
 queue
 
 quota
 
 count
 

Detailed Description

Proposed new threading module, emulating a subset of Java's threading model.

Function Documentation

def threading.activeCount ( )

Definition at line 588 of file threading.py.

589 def activeCount():
590  _active_limbo_lock.acquire()
591  count = len(_active) + len(_limbo)
592  _active_limbo_lock.release()
593  return count
def threading.BoundedSemaphore (   args,
  kwargs 
)

Definition at line 287 of file threading.py.

288 def BoundedSemaphore(*args, **kwargs):
289  return apply(_BoundedSemaphore, args, kwargs)
def threading.Condition (   args,
  kwargs 
)

Definition at line 135 of file threading.py.

136 def Condition(*args, **kwargs):
137  return apply(_Condition, args, kwargs)
def threading.currentThread ( )

Definition at line 581 of file threading.py.

References _get_ident.

582 def currentThread():
583  try:
584  return _active[_get_ident()]
585  except KeyError:
586  ##print "currentThread(): no current thread for", _get_ident()
587  return _DummyThread()
def threading.enumerate ( )

Definition at line 594 of file threading.py.

References audiodev.__init__().

595 def enumerate():
596  _active_limbo_lock.acquire()
597  active = _active.values() + _limbo.values()
598  _active_limbo_lock.release()
599  return active
600 
601 
602 # Create the main thread object
603 
604 _MainThread()
605 
606 
607 # Self-test code
def threading.Event (   args,
  kwargs 
)

Definition at line 302 of file threading.py.

303 def Event(*args, **kwargs):
304  return apply(_Event, args, kwargs)
def threading.RLock (   args,
  kwargs 
)

Definition at line 64 of file threading.py.

64 
65 def RLock(*args, **kwargs):
66  return apply(_RLock, args, kwargs)
def threading.Semaphore (   args,
  kwargs 
)

Definition at line 245 of file threading.py.

246 def Semaphore(*args, **kwargs):
247  return apply(_Semaphore, args, kwargs)
def threading.Timer (   args,
  kwargs 
)

Definition at line 490 of file threading.py.

491 def Timer(*args, **kwargs):
492  return _Timer(*args, **kwargs)

Variable Documentation

dictionary _active = {}

Definition at line 343 of file threading.py.

tuple _active_limbo_lock = _allocate_lock()

Definition at line 342 of file threading.py.

_allocate_lock = thread.allocate_lock

Definition at line 19 of file threading.py.

int _counter = 0

Definition at line 335 of file threading.py.

_get_ident = thread.get_ident

Definition at line 20 of file threading.py.

dictionary _limbo = {}

Definition at line 344 of file threading.py.

_print_exc = traceback.print_exc

Definition at line 24 of file threading.py.

_sleep = time.sleep

Definition at line 15 of file threading.py.

_start_new_thread = thread.start_new_thread

Definition at line 18 of file threading.py.

_StringIO = StringIO.StringIO

Definition at line 27 of file threading.py.

_sys = sys

Definition at line 11 of file threading.py.

_time = time.time

Definition at line 14 of file threading.py.

int _VERBOSE = 0

Definition at line 33 of file threading.py.

count

Definition at line 664 of file threading.py.

limit

Definition at line 617 of file threading.py.

Lock = _allocate_lock

Definition at line 62 of file threading.py.

mon

Definition at line 614 of file threading.py.

queue

Definition at line 618 of file threading.py.

quota

Definition at line 648 of file threading.py.

rc

Definition at line 615 of file threading.py.

ThreadError = thread.error

Definition at line 21 of file threading.py.

wc

Definition at line 616 of file threading.py.