00001 /* hey emacs! -*- Mode: C++; c-file-style: "stroustrup"; indent-tabs-mode: nil -*- */ 00002 /* 00003 * Mutex.h 00004 * 00005 * $Id: Mutex.h,v 1.3 2000/12/27 16:59:27 rex Exp $ 00006 * 00007 * Copyright (c) 2000 Benoit Joly <benoit@dhis.net> 00008 * 00009 * DDT comes with ABSOLUTELY NO WARRANTY and is licenced under the 00010 * GNU General Public License (version 2 or later). This license 00011 * can be retrieved from http://www.gnu.org/copyleft/gnu.html. 00012 * 00013 */ 00014 00015 #ifndef MUTEX_HH 00016 #define MUTEX_HH 00017 00018 #include <pthread.h> 00019 00024 class Mutex 00025 { 00026 public: 00028 Mutex(); 00029 00031 ~Mutex(); 00032 00034 void lock(); 00035 00037 void unlock(); 00038 00040 bool trylock(); 00041 00042 00043 private: 00045 pthread_mutex_t a_mutex; 00046 }; 00047 #endif
1.4.4