libzypp  10.5.0
Mutex.h
Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00011 #ifndef   ZYPP_THREAD_MUTEX_H
00012 #define   ZYPP_THREAD_MUTEX_H
00013 
00014 #include <zypp/base/NonCopyable.h>
00015 #include <zypp/thread/MutexException.h>
00016 #include <pthread.h>
00017 
00019 namespace zypp
00020 { 
00021 
00022   namespace thread
00023   { 
00024 
00025 
00026     typedef pthread_mutex_t RecursiveMutex_t;
00027 
00028 
00030     //
00031     // CLASS NAME : Mutex
00032     //
00035     class Mutex: public zypp::base::NonCopyable
00036     {
00037     public:
00041       Mutex();
00042 
00045       ~Mutex();
00046 
00058       void lock();
00059 
00068       void unlock();
00069 
00079       bool trylock();
00080 
00081     private:
00082       RecursiveMutex_t m_mutex;
00083     };
00084 
00085 
00087   } // namespace thread
00090 } // namespace zypp
00092 
00093 #endif // ZYPP_THREAD_MUTEX_H
00094 /*
00095 ** vim: set ts=2 sts=2 sw=2 ai et:
00096 */