• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

ut_mutexImpl.h

Go to the documentation of this file.
00001 /* AbiSource Program Utilities
00002  * Copyright (C) 2002 Dom Lachowicz <cinamod@hotmail.com>
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017  * 02110-1301 USA.
00018  */
00019 
00020 #ifndef UT_MUTEXIMPL_H
00021 #define UT_MUTEXIMPL_H
00022 
00023 #include <windows.h>
00024 #include "ut_types.h"
00025 
00029 class ABI_EXPORT UT_MutexImpl
00030 {
00031  public:
00032 
00033   UT_MutexImpl ()
00034     {
00035       ::InitializeCriticalSection(&m_cs);
00036     }
00037 
00038   ~UT_MutexImpl ()
00039     {
00040       ::DeleteCriticalSection(&m_cs);
00041     }
00042 
00043   void lock ()
00044     {
00045       ::EnterCriticalSection(&m_cs );
00046     }
00047 
00048   void unlock ()
00049     {
00050       ::LeaveCriticalSection(&m_cs);
00051     }
00052 
00053  private:
00054 
00055   // no impls
00056   UT_MutexImpl (const UT_MutexImpl & other);
00057   UT_MutexImpl & operator=(const UT_MutexImpl & other);
00058 
00059   CRITICAL_SECTION m_cs;
00060 };
00061 
00062 #endif /* UT_MUTEXIMPL_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1