Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions
threading._DummyThread Class Reference
Inheritance diagram for threading._DummyThread:
Inheritance graph
[legend]
Collaboration diagram for threading._DummyThread:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def join
def daemon
def daemon
def name
def name
def __repr__
def start
def run
def ident
def is_alive
def isDaemon
def setDaemon
def getName
def setName

Public Attributes

 daemon
 name
_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Static Public Attributes

 isAlive = is_alive

Private Member Functions

def _set_daemon

Detailed Description

Definition at line 992 of file threading.py.


Constructor & Destructor Documentation

Definition at line 994 of file threading.py.

00994 
00995     def __init__(self):
00996         Thread.__init__(self, name=_newname("Dummy-%d"))
00997 
00998         # Thread._block consumes an OS-level locking primitive, which
00999         # can never be used by a _DummyThread.  Since a _DummyThread
01000         # instance is immortal, that's bad, so release this resource.
01001         del self._block
01002 
01003         self._started.set()
01004         self._set_ident()
01005         with _active_limbo_lock:
01006             _active[self._ident] = self

Here is the call graph for this function:

Here is the caller graph for this function:


Member Function Documentation

def threading.Thread.__repr__ (   self) [inherited]

Definition at line 659 of file threading.py.

00659 
00660     def __repr__(self):
00661         assert self._initialized, "Thread.__init__() was not called"
00662         status = "initial"
00663         if self._started.is_set():
00664             status = "started"
00665         if self._stopped:
00666             status = "stopped"
00667         if self._daemonic:
00668             status += " daemon"
00669         if self._ident is not None:
00670             status += " %s" % self._ident
00671         return "<%s(%s, %s)>" % (self.__class__.__name__, self._name, status)

def threading._DummyThread._set_daemon (   self) [private]

Reimplemented from threading.Thread.

Definition at line 1007 of file threading.py.

01007 
01008     def _set_daemon(self):
01009         return True

def threading.Thread.daemon (   self) [inherited]

Definition at line 894 of file threading.py.

00894 
00895     def daemon(self):
00896         assert self._initialized, "Thread.__init__() not called"
00897         return self._daemonic

def threading.Thread.daemon (   self,
  daemonic 
) [inherited]

Definition at line 899 of file threading.py.

00899 
00900     def daemon(self, daemonic):
00901         if not self._initialized:
00902             raise RuntimeError("Thread.__init__() not called")
00903         if self._started.is_set():
00904             raise RuntimeError("cannot set daemon status of active thread");
00905         self._daemonic = daemonic

def threading.Thread.getName (   self) [inherited]

Definition at line 912 of file threading.py.

00912 
00913     def getName(self):
00914         return self.name

def threading.Thread.ident (   self) [inherited]

Definition at line 883 of file threading.py.

00883 
00884     def ident(self):
00885         assert self._initialized, "Thread.__init__() not called"
00886         return self._ident

def threading.Thread.is_alive (   self) [inherited]

Definition at line 887 of file threading.py.

00887 
00888     def is_alive(self):
00889         assert self._initialized, "Thread.__init__() not called"
00890         return self._started.is_set() and not self._stopped

Here is the caller graph for this function:

def threading.Thread.isDaemon (   self) [inherited]

Definition at line 906 of file threading.py.

00906 
00907     def isDaemon(self):
00908         return self.daemon

def threading._DummyThread.join (   self,
  timeout = None 
)

Reimplemented from threading.Thread.

Definition at line 1010 of file threading.py.

01010 
01011     def join(self, timeout=None):
01012         assert False, "cannot join a dummy thread"
01013 
01014 
01015 # Global API functions

def threading.Thread.name (   self) [inherited]

Definition at line 873 of file threading.py.

00873 
00874     def name(self):
00875         assert self._initialized, "Thread.__init__() not called"
00876         return self._name

Here is the caller graph for this function:

def threading.Thread.name (   self,
  name 
) [inherited]

Definition at line 878 of file threading.py.

00878 
00879     def name(self, name):
00880         assert self._initialized, "Thread.__init__() not called"
00881         self._name = str(name)

Here is the caller graph for this function:

def threading.Thread.run (   self) [inherited]

Reimplemented in test.test_ssl.AsyncoreEchoServer, threading._Timer, test.test_ssl.ThreadedEchoServer, test.test_ssl.ThreadedEchoServer.ConnectionHandler, test.test_ftplib.DummyFTPServer, test.ssl_servers.HTTPSServerThread, test.test_poplib.DummyPOP3Server, test.test_urllib2_localnet.LoopbackHttpServerThread, test.test_httpservers.TestServerThread, test.test_threading.TestThread, test.test_asynchat.echo_server, test.test_threadedtempfile.TempFileGreedy, test.threaded_import_hangers.Worker, and test.test_queue._TriggerThread.

Definition at line 690 of file threading.py.

00690 
00691     def run(self):
00692         try:
00693             if self._target:
00694                 self._target(*self._args, **self._kwargs)
00695         finally:
00696             # Avoid a refcycle if the thread is running a function with
00697             # an argument that has a member that points to the thread.
00698             del self._target, self._args, self._kwargs

Here is the caller graph for this function:

def threading.Thread.setDaemon (   self,
  daemonic 
) [inherited]

Definition at line 909 of file threading.py.

00909 
00910     def setDaemon(self, daemonic):
00911         self.daemon = daemonic

def threading.Thread.setName (   self,
  name 
) [inherited]

Definition at line 915 of file threading.py.

00915 
00916     def setName(self, name):
00917         self.name = name
00918 
00919 # The timer class was contributed by Itamar Shtull-Trauring

def threading.Thread.start (   self) [inherited]

Reimplemented in test.test_ftplib.DummyFTPServer, test.test_poplib.DummyPOP3Server, and multiprocessing.dummy.DummyProcess.

Definition at line 672 of file threading.py.

00672 
00673     def start(self):
00674         if not self._initialized:
00675             raise RuntimeError("thread.__init__() not called")
00676 
00677         if self._started.is_set():
00678             raise RuntimeError("threads can only be started once")
00679         if __debug__:
00680             self._note("%s.start(): starting thread", self)
00681         with _active_limbo_lock:
00682             _limbo[self] = self
00683         try:
00684             _start_new_thread(self._bootstrap, ())
00685         except Exception:
00686             with _active_limbo_lock:
00687                 del _limbo[self]
00688             raise
00689         self._started.wait()

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

threading.Thread.isAlive = is_alive [static, inherited]

Definition at line 891 of file threading.py.

threading.Thread.name [inherited]

Definition at line 916 of file threading.py.

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.


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