spinlock.hh

Go to the documentation of this file.
00001 //
00002 // $Id: spinlock.hh,v 1.6 2003/10/30 15:05:13 cholm Exp $ 
00003 //  
00004 //  threadmm::spinlock
00005 //  Copyright (C) 2002 Christian Holm Christensen <cholm@nbi.dk> 
00006 //
00007 //  This library is free software; you can redistribute it and/or 
00008 //  modify it under the terms of the GNU Lesser General Public License 
00009 //  as published by the Free Software Foundation; either version 2.1 
00010 //  of the License, or (at your option) any later version. 
00011 //
00012 //  This library is distributed in the hope that it will be useful, 
00013 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
00014 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
00015 //  Lesser General Public License for more details. 
00016 // 
00017 //  You should have received a copy of the GNU Lesser General Public 
00018 //  License along with this library; if not, write to the Free 
00019 //  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 
00020 //  02111-1307 USA 
00021 //
00022 #ifndef THREADMM_spinlock
00023 #define THREADMM_spinlock
00024 // #ifndef THREADMM_threadmm
00025 // #include <threadmm/threadmm.hh>
00026 // #endif
00027 
00033 #if defined(THREADMM_POSIX) && defined(THREADMM_POSIX_SPINLOCK)
00034 # include <threadmm/posix/spinlock.hh>
00035 # define THREADMM_SPINLOCK_BACKEND ::threadmm::posix::spinlock
00036 #else
00037 # include <threadmm/basic/spinlock.hh>
00038 # define THREADMM_SPINLOCK_BACKEND ::threadmm::basic::spinlock
00039 #endif
00040 
00041 namespace threadmm 
00042 {
00050   template <typename Backend=THREADMM_SPINLOCK_BACKEND>
00051   class basic_spinlock : public Backend
00052   {
00053   public:
00055     typedef Backend backend_type;
00059     basic_spinlock(bool shared=false) : backend_type(shared) {}
00060   };
00061 #ifdef THREADMM_USE_TYPEDEFS
00062   typedef basic_spinlock<> spinlock;
00063 #endif
00064 }
00065 
00066 #endif
00067 //____________________________________________________________________
00068 //
00069 // EOF
00070 //
Top of page
Last update Tue Nov 9 12:40:50 2004
Christian Holm
Created by DoxyGen 1.3.9.1