00001 /****************** <VPR heading BEGIN do not edit this line> ***************** 00002 * 00003 * VR Juggler Portable Runtime 00004 * 00005 * Original Authors: 00006 * Allen Bierbaum, Patrick Hartling, Kevin Meinert, Carolina Cruz-Neira 00007 * 00008 * ----------------------------------------------------------------- 00009 * File: $RCSfile$ 00010 * Date modified: $Date: 2005-01-17 22:34:01 -0600 (Mon, 17 Jan 2005) $ 00011 * Version: $Revision: 16635 $ 00012 * ----------------------------------------------------------------- 00013 * 00014 ****************** <VPR heading END do not edit this line> ******************/ 00015 00016 /*************** <auto-copyright.pl BEGIN do not edit this line> ************** 00017 * 00018 * VR Juggler is (C) Copyright 1998-2005 by Iowa State University 00019 * 00020 * Original Authors: 00021 * Allen Bierbaum, Christopher Just, 00022 * Patrick Hartling, Kevin Meinert, 00023 * Carolina Cruz-Neira, Albert Baker 00024 * 00025 * This library is free software; you can redistribute it and/or 00026 * modify it under the terms of the GNU Library General Public 00027 * License as published by the Free Software Foundation; either 00028 * version 2 of the License, or (at your option) any later version. 00029 * 00030 * This library is distributed in the hope that it will be useful, 00031 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00032 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00033 * Library General Public License for more details. 00034 * 00035 * You should have received a copy of the GNU Library General Public 00036 * License along with this library; if not, write to the 00037 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00038 * Boston, MA 02111-1307, USA. 00039 * 00040 *************** <auto-copyright.pl END do not edit this line> ***************/ 00041 00042 #ifndef _vprNullMutex_h_ 00043 #define _vprNullMutex_h_ 00044 00045 #include <vpr/vprConfig.h> 00046 #include <stdio.h> 00047 #include <vpr/Util/ReturnStatus.h> 00048 00049 00050 namespace vpr 00051 { 00052 00059 class VPR_CLASS_API NullMutex 00060 { 00061 public: 00062 NullMutex() 00063 {;} 00064 00065 ~NullMutex() 00066 {;} 00067 00074 vpr::ReturnStatus acquire() const 00075 { 00076 return vpr::ReturnStatus(); 00077 } 00078 00080 vpr::ReturnStatus acquireRead() const 00081 { 00082 return this->acquire(); // No special "read" semaphore -- For now 00083 } 00084 00086 vpr::ReturnStatus acquireWrite() const 00087 { 00088 return this->acquire(); // No special "write" semaphore -- For now 00089 } 00090 00098 vpr::ReturnStatus tryAcquire() const 00099 { 00100 return vpr::ReturnStatus(); 00101 } 00102 00104 vpr::ReturnStatus tryacquire_read() const 00105 { 00106 return this->tryAcquire(); 00107 } 00108 00110 vpr::ReturnStatus tryacquire_write() const 00111 { 00112 return this->tryAcquire(); 00113 } 00114 00120 vpr::ReturnStatus release() const 00121 { 00122 return vpr::ReturnStatus(); 00123 } 00124 00131 int test() 00132 { 00133 return 0; // Just return 0 since it is a null lock 00134 } 00135 00137 void dump(FILE* dest = stderr, 00138 const char* message = "\n------ Mutex Dump -----\n") const 00139 { 00140 fprintf(dest, "%sNULL Mutex", message); 00141 } 00142 00143 protected: 00144 // = Prevent assignment and initialization. 00145 void operator= (const NullMutex &) {} 00146 NullMutex (const NullMutex &) {} 00147 }; 00148 00149 } // End of vpr namespace 00150 00151 00152 #endif
1.5.1