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

igtlSimpleFastMutexLock.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Open IGT Link Library
00004   Module:    $HeadURL: http://svn.na-mic.org/NAMICSandBox/trunk/OpenIGTLink/Source/igtlSimpleFastMutexLock.h $
00005   Language:  C++
00006   Date:      $Date: 2008-12-22 19:05:42 -0500 (Mon, 22 Dec 2008) $
00007   Version:   $Revision: 3460 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010 
00011   This software is distributed WITHOUT ANY WARRANTY; without even
00012   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00013   PURPOSE.  See the above copyright notices for more information.
00014 
00015 =========================================================================*/
00016 /*=========================================================================
00017 
00018   Program:   Insight Segmentation & Registration Toolkit
00019   Module:    $RCSfile: itkSimpleFastMutexLock.h,v $
00020   Language:  C++
00021   Date:      $Date: 2008-12-22 19:05:42 -0500 (Mon, 22 Dec 2008) $
00022   Version:   $Revision: 3460 $
00023 
00024   Copyright (c) Insight Software Consortium. All rights reserved.
00025   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00026 
00027   Portions of this code are covered under the VTK copyright.
00028   See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
00029 
00030      This software is distributed WITHOUT ANY WARRANTY; without even 
00031      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00032      PURPOSE.  See the above copyright notices for more information.
00033 
00034 =========================================================================*/
00035 #ifndef __igtlSimpleFastMutexLock_h
00036 #define __igtlSimpleFastMutexLock_h
00037 
00038 #include "igtlMacro.h"
00039 
00040 #ifdef OpenIGTLink_USE_SPROC
00041 #include <abi_mutex.h>
00042 #endif
00043 
00044 #ifdef OpenIGTLink_USE_PTHREADS
00045 #include <pthread.h>
00046 #endif
00047  
00048 #if defined(_WIN32) && !defined(OpenIGTLink_USE_PTHREADS)
00049 #include "igtlWindows.h"
00050 #endif
00051 
00052 namespace igtl
00053 {
00054 
00055 #ifdef OpenIGTLink_USE_SPROC
00056 #include <abi_mutex.h>
00057 typedef abilock_t FastMutexType;
00058 #endif
00059 
00060 #ifdef OpenIGTLink_USE_PTHREADS
00061 #include <pthread.h>
00062 typedef pthread_mutex_t FastMutexType;
00063 #endif
00064  
00065 #if defined(_WIN32) && !defined(OpenIGTLink_USE_PTHREADS)
00066 #include <winbase.h>
00067 typedef CRITICAL_SECTION FastMutexType;
00068 #endif
00069 
00070 #ifndef OpenIGTLink_USE_SPROC
00071 #ifndef OpenIGTLink_USE_PTHREADS
00072 #ifndef _WIN32
00073 typedef int FastMutexType;
00074 #endif
00075 #endif
00076 #endif
00077 
00088 // Critical Section object that is not a igtlObject.
00089 class IGTLCommon_EXPORT SimpleFastMutexLock
00090 {
00091 public:
00093   typedef SimpleFastMutexLock       Self;
00094 
00096   SimpleFastMutexLock();
00097   ~SimpleFastMutexLock();
00099 
00101   void Lock() const;
00102 
00104   void Unlock() const;
00105 
00106 protected:
00107   mutable FastMutexType   m_FastMutexLock;
00108 };
00109 
00110 }//end igtl namespace
00111 #endif
00112 
00113 

Generated at Sat May 9 04:47:23 2009 for OpenIGTLink by doxygen 1.5.9 written by Dimitri van Heesch, © 1997-2000