Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/express/threadDummyImpl.h

Go to the documentation of this file.
00001 // Filename: threadDummyImpl.h
00002 // Created by:  drose (09Aug02)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 #ifndef THREADDUMMYIMPL_H
00020 #define THREADDUMMYIMPL_H
00021 
00022 #include "pandabase.h"
00023 #include "selectThreadImpl.h"
00024 
00025 #ifdef THREAD_DUMMY_IMPL
00026 
00027 #include "notify.h"
00028 #include "threadPriority.h"
00029 #include "pmutex.h"
00030 
00031 #include <prthread.h>
00032 
00033 class Thread;
00034 
00035 // The Irix system headers may define this as a macro.  Get it out of
00036 // the way.
00037 #ifdef atomic_set
00038 #undef atomic_set
00039 #endif
00040 
00041 ////////////////////////////////////////////////////////////////////
00042 //       Class : ThreadDummyImpl
00043 // Description : A fake thread implementation for single-threaded
00044 //               applications.  This simply fails whenever you try to
00045 //               start a thread.
00046 ////////////////////////////////////////////////////////////////////
00047 class EXPCL_PANDAEXPRESS ThreadDummyImpl {
00048 public:
00049   INLINE ThreadDummyImpl(Thread *parent_obj);
00050   INLINE ~ThreadDummyImpl();
00051 
00052   INLINE bool start(ThreadPriority priority, bool global, bool joinable);
00053   INLINE void join();
00054 
00055   INLINE static void prepare_for_exit();
00056 
00057   INLINE static Thread *get_current_thread();
00058   INLINE static bool is_threading_supported();
00059   INLINE static void sleep(double seconds);
00060 
00061   INLINE int atomic_inc(int &var);
00062   INLINE int atomic_dec(int &var);
00063   INLINE int atomic_set(int &var, int new_value);
00064 };
00065 
00066 #include "threadDummyImpl.I"
00067 
00068 #endif // THREAD_DUMMY_IMPL
00069 
00070 #endif

Generated on Fri May 2 00:38:41 2003 for Panda by doxygen1.3