Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
Thread Class Reference
Inheritance diagram for Thread:
_Verbose _DummyThread _MainThread _Timer

Public Member Functions

def __init__
 
def __repr__
 
def start
 
def run
 
def join
 
def getName
 
def setName
 
def isAlive
 
def isDaemon
 
def setDaemon
 
- Public Member Functions inherited from _Verbose
def __init__
 
def __init__
 

Detailed Description

Definition at line 349 of file threading.py.

Constructor & Destructor Documentation

def __init__ (   self,
  group = None,
  target = None,
  name = None,
  args = (),
  kwargs = {},
  verbose = None 
)

Definition at line 354 of file threading.py.

References Thread.__args, _RLock.__block, Thread.__block, Thread.__daemonic, Thread.__initialized, Thread.__kwargs, Symbol.__name, _Printer.__name, Thread.__name, Thread.__started, Thread.__stopped, Thread.__target, Thread._set_daemon(), threading.Condition(), threading.currentThread(), Thread.isDaemon(), threading.Lock, and locale.str().

355  args=(), kwargs={}, verbose=None):
356  assert group is None, "group argument must be None for now"
357  _Verbose.__init__(self, verbose)
358  self.__target = target
359  self.__name = str(name or _newname())
360  self.__args = args
361  self.__kwargs = kwargs
362  self.__daemonic = self._set_daemon()
363  self.__started = 0
364  self.__stopped = 0
365  self.__block = Condition(Lock())
366  self.__initialized = 1

Member Function Documentation

def __repr__ (   self)

Definition at line 371 of file threading.py.

References Thread.__daemonic, Thread.__initialized, Symbol.__name, _Printer.__name, Thread.__name, Thread.__started, and Thread.__stopped.

372  def __repr__(self):
373  assert self.__initialized, "Thread.__init__() was not called"
374  status = "initial"
375  if self.__started:
376  status = "started"
377  if self.__stopped:
378  status = "stopped"
379  if self.__daemonic:
380  status = status + " daemon"
381  return "<%s(%s, %s)>" % (self.__class__.__name__, self.__name, status)
def getName (   self)

Definition at line 467 of file threading.py.

References Thread.__initialized, Symbol.__name, _Printer.__name, and Thread.__name.

468  def getName(self):
469  assert self.__initialized, "Thread.__init__() not called"
470  return self.__name
def isAlive (   self)

Definition at line 475 of file threading.py.

References Thread.__initialized, Thread.__started, and Thread.__stopped.

476  def isAlive(self):
477  assert self.__initialized, "Thread.__init__() not called"
478  return self.__started and not self.__stopped
def isDaemon (   self)

Definition at line 479 of file threading.py.

References Thread.__daemonic, and Thread.__initialized.

480  def isDaemon(self):
481  assert self.__initialized, "Thread.__init__() not called"
482  return self.__daemonic
def join (   self,
  timeout = None 
)

Definition at line 440 of file threading.py.

References Thread.__initialized, Thread.__started, Thread.__stopped, _Verbose._note(), threading._time, and threading.currentThread().

441  def join(self, timeout=None):
442  assert self.__initialized, "Thread.__init__() not called"
443  assert self.__started, "cannot join thread before it is started"
444  assert self is not currentThread(), "cannot join current thread"
445  if __debug__:
446  if not self.__stopped:
447  self._note("%s.join(): waiting until thread stops", self)
448  self.__block.acquire()
449  if timeout is None:
450  while not self.__stopped:
451  self.__block.wait()
452  if __debug__:
453  self._note("%s.join(): thread stopped", self)
454  else:
455  deadline = _time() + timeout
456  while not self.__stopped:
457  delay = deadline - _time()
458  if delay <= 0:
459  if __debug__:
460  self._note("%s.join(): timed out", self)
461  break
462  self.__block.wait(delay)
463  else:
464  if __debug__:
465  self._note("%s.join(): thread stopped", self)
466  self.__block.release()
def run (   self)

Definition at line 394 of file threading.py.

References Thread.__args, Thread.__delete(), Thread.__kwargs, Thread.__started, Thread.__stop(), Thread.__stopped, Thread.__target, threading._get_ident, _Verbose._note(), threading._print_exc, threading._StringIO, Thread.getName(), scheduler.run(), Bdb.run(), Thread.run(), Profile.run(), and ModuleScanner.run().

395  def run(self):
396  if self.__target:
397  apply(self.__target, self.__args, self.__kwargs)
def setDaemon (   self,
  daemonic 
)

Definition at line 483 of file threading.py.

References Thread.__daemonic, Thread.__initialized, and Thread.__started.

484  def setDaemon(self, daemonic):
485  assert self.__initialized, "Thread.__init__() not called"
486  assert not self.__started, "cannot set daemon status of active thread"
487  self.__daemonic = daemonic
488 
489 # The timer class was contributed by Itamar Shtull-Trauring
def setName (   self,
  name 
)

Definition at line 471 of file threading.py.

References Thread.__initialized, Symbol.__name, _Printer.__name, Thread.__name, and locale.str().

472  def setName(self, name):
473  assert self.__initialized, "Thread.__init__() not called"
474  self.__name = str(name)
def start (   self)

Definition at line 382 of file threading.py.

References Thread.__bootstrap(), Thread.__initialized, Thread.__started, _Verbose._note(), threading._sleep, and threading._start_new_thread.

383  def start(self):
384  assert self.__initialized, "Thread.__init__() not called"
385  assert not self.__started, "thread already started"
386  if __debug__:
387  self._note("%s.start(): starting thread", self)
388  _active_limbo_lock.acquire()
389  _limbo[self] = self
390  _active_limbo_lock.release()
392  self.__started = 1
393  _sleep(0.000001) # 1 usec, to let the thread run (Solaris hack)

The documentation for this class was generated from the following file: