00001 // Filename: mutexDummyImpl.h 00002 // Created by: drose (08Aug02) 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 MUTEXDUMMYIMPL_H 00020 #define MUTEXDUMMYIMPL_H 00021 00022 #include "pandabase.h" 00023 #include "selectThreadImpl.h" 00024 00025 #ifdef THREAD_DUMMY_IMPL 00026 00027 #include "notify.h" 00028 00029 //////////////////////////////////////////////////////////////////// 00030 // Class : MutexDummyImpl 00031 // Description : A fake mutex implementation for single-threaded 00032 // applications that don't need any synchronization 00033 // control. This does nothing but assert that the same 00034 // process does not try to grab the mutex twice. 00035 //////////////////////////////////////////////////////////////////// 00036 class EXPCL_PANDAEXPRESS MutexDummyImpl { 00037 public: 00038 INLINE MutexDummyImpl(); 00039 INLINE ~MutexDummyImpl(); 00040 00041 INLINE void lock(); 00042 INLINE void release(); 00043 00044 private: 00045 #ifndef NDEBUG 00046 int _lock_count; 00047 #endif 00048 }; 00049 00050 #include "mutexDummyImpl.I" 00051 00052 #endif // THREAD_DUMMY_IMPL 00053 00054 #endif