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

wefts_mutex.h

Go to the documentation of this file.
00001 /*
00002    wefts_mutex.h
00003    Mutex object header file.
00004 
00005    $Id: wefts_mutex.h,v 1.2 2003/08/05 15:40:20 jonnymind Exp $
00006 ---------------------------------------
00007    Begin      : 2003-08-02 23:31
00008    Author     : Giancarlo Niccolai
00009 
00010    Last modified because:
00011 
00012 */
00013 
00014 /**************************************************************************
00015 *   This program is free software; you can redistribute it and/or modify  *
00016 *   it under the terms of the GNU Library General Public License as       *
00017 *   published by the Free Software Foundation; either version 2.1 of the  *
00018 *   License, or (at your option) any later version.                       *
00019 ***************************************************************************/
00020 
00021 #ifndef WT_MUTEX_H
00022 #define WT_MUTEX_H
00023 
00024 #ifdef __extern_c
00025 extern "C" {
00026 #endif
00027 
00028 #include <pthread.h>
00029 
00030 #ifdef __extern_c
00031 }
00032 #endif
00033 
00034 namespace Wefts {
00035 
00045 class Mutex {
00046 protected:
00047    pthread_mutex_t   m_mutex;
00048 
00049 public:
00051    Mutex() { pthread_mutex_init( &m_mutex, NULL ); }
00052 
00056    ~Mutex() { pthread_mutex_destroy( &m_mutex ); }
00057 
00062    virtual inline void lock() { pthread_mutex_lock( &m_mutex); }
00063 
00069    virtual inline void unlock() { pthread_mutex_unlock( &m_mutex ); }
00070 };
00071 
00072 }
00073 #endif
00074 /* end of wefts_mutex.h */

Generated on Tue Aug 5 18:09:00 2003 for Wefts by doxygen1.2.18