Panda3D
 All Classes Functions Variables Enumerations
Public Member Functions | Static Public Member Functions | Friends | List of all members
MainThread Class Reference

The special "main thread" class. More...

#include "mainThread.h"

Inheritance diagram for MainThread:
Thread TypedReferenceCount Namable TypedObject ReferenceCount MemoryBase MemoryBase MemoryBase

Public Member Functions

virtual TypeHandle force_init_type ()
 
virtual TypeHandle get_type () const
 
- Public Member Functions inherited from Thread
AsyncTaskBaseget_current_task () const
 Returns the task currently executing on this thread (via the AsyncTaskManager), if any, or NULL if the thread is not currently servicing a task. More...
 
int get_pipeline_stage () const
 Returns the Pipeline stage number associated with this thread. More...
 
PStatsCallbackget_pstats_callback () const
 Returns the PStats callback associated with this thread, or NULL if no callback has yet been associated with this thread. More...
 
int get_pstats_index () const
 Returns the PStats index associated with this thread, or -1 if no index has yet been associated with this thread. More...
 
const string & get_sync_name () const
 Returns the sync name of the thread. More...
 
string get_unique_id () const
 Returns a string that is guaranteed to be unique to this thread, across all processes on the machine, during at least the lifetime of this process. More...
 
bool is_joinable () const
 Returns the value of joinable that was passed to the start() call. More...
 
bool is_started () const
 Returns true if the thread has been started, false if it has not, or if join() has already been called. More...
 
void join ()
 Blocks the calling process until the thread terminates. More...
 
virtual void output (ostream &out) const
 
void output_blocker (ostream &out) const
 Writes a description of the mutex or condition variable that this thread is blocked on. More...
 
void preempt ()
 Indicates that this thread should run as soon as possible, preemptying any other threads that may be scheduled to run. More...
 
void set_min_pipeline_stage (int min_pipeline_stage)
 Sets this thread's pipeline stage number to at least the indicated value, unless it is already larger. More...
 
void set_pipeline_stage (int pipeline_stage)
 Specifies the Pipeline stage number associated with this thread. More...
 
void set_pstats_callback (PStatsCallback *pstats_callback)
 Stores a PStats callback to be associated with this thread. More...
 
void set_pstats_index (int pstats_index)
 Stores a PStats index to be associated with this thread. More...
 
bool start (ThreadPriority priority, bool joinable)
 Starts the thread executing. More...
 
- Public Member Functions inherited from TypedReferenceCount
 TypedReferenceCount (const TypedReferenceCount &copy)
 
void operator= (const TypedReferenceCount &copy)
 
- Public Member Functions inherited from TypedObject
 TypedObject (const TypedObject &copy)
 
TypedObjectas_typed_object ()
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
const TypedObjectas_typed_object () const
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
int get_best_parent_from_Set (const std::set< int > &) const
 
int get_type_index () const
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More...
 
bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly. More...
 
bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type. More...
 
void operator= (const TypedObject &copy)
 
- Public Member Functions inherited from ReferenceCount
int get_ref_count () const
 Returns the current reference count. More...
 
WeakReferenceListget_weak_list () const
 Returns the WeakReferenceList associated with this ReferenceCount object. More...
 
bool has_weak_list () const
 Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. More...
 
void local_object ()
 This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. More...
 
void ref () const
 Explicitly increments the reference count. More...
 
bool test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus. More...
 
bool test_ref_count_nonzero () const
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More...
 
virtual bool unref () const
 Explicitly decrements the reference count. More...
 
void weak_ref (WeakPointerToVoid *ptv)
 Adds the indicated PointerToVoid as a weak reference to this object. More...
 
void weak_unref (WeakPointerToVoid *ptv)
 Removes the indicated PointerToVoid as a weak reference to this object. More...
 
- Public Member Functions inherited from Namable
 Namable (const string &initial_name="")
 
 Namable (const Namable &copy)
 
void clear_name ()
 Resets the Namable's name to empty. More...
 
const string & get_name () const
 
bool has_name () const
 Returns true if the Namable has a nonempty name set, false if the name is empty. More...
 
Namableoperator= (const Namable &other)
 
void output (ostream &out) const
 Outputs the Namable. More...
 
void set_name (const string &name)
 

Static Public Member Functions

static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from Thread
static void consider_yield ()
 Possibly suspends the current thread for the rest of the current epoch, if it has run for enough this epoch. More...
 
static void force_yield ()
 Suspends the current thread for the rest of the current epoch. More...
 
static TypeHandle get_class_type ()
 
static int get_current_pipeline_stage ()
 Returns the integer pipeline stage associated with the current thread. More...
 
static Threadget_current_thread ()
 Returns a pointer to the currently-executing Thread object. More...
 
static Threadget_external_thread ()
 Returns a pointer to the "external" Thread object–this is a special Thread object that corresponds to any thread spawned outside of Panda's threading interface. More...
 
static Threadget_main_thread ()
 Returns a pointer to the "main" Thread object–this is the Thread that started the whole process. More...
 
static void init_type ()
 
static bool is_simple_threads ()
 Returns true if Panda is currently compiled for "simple threads", which is to say, cooperative context switching only, reducing the need for quite so many critical section protections. More...
 
static bool is_threading_supported ()
 Returns true if threading support has been compiled in and enabled, or false if no threading is available (and Thread::start() will always fail). More...
 
static bool is_true_threads ()
 Returns true if a real threading library is available that supports actual OS-implemented threads, or false if the only threading we can provide is simulated user-space threading. More...
 
static void prepare_for_exit ()
 Should be called by the main thread just before exiting the program, this blocks until any remaining thread cleanup has finished. More...
 
static PT (Thread) bind_thread(const string &name
 
static void sleep (double seconds)
 Suspends the current thread for at least the indicated amount of time. More...
 
static void write_status (ostream &out)
 
- Static Public Member Functions inherited from TypedReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from TypedObject
static TypeHandle get_class_type ()
 
static void init_type ()
 This function is declared non-inline to work around a compiler bug in g++ 2.96. More...
 
- Static Public Member Functions inherited from ReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from Namable
static TypeHandle get_class_type ()
 
static void init_type ()
 

Friends

class Thread
 

Additional Inherited Members

- Public Attributes inherited from Thread
static const string & sync_name
 

Detailed Description

The special "main thread" class.

There is one instance of these in the world, and it is returned by Thread::get_main_thread().

Definition at line 27 of file mainThread.h.


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