CARMA C++
PthreadMutexAttr.h
1 #ifndef CARMA_UTIL_PTHREAD_MUTEX_ATTR_H
2 #define CARMA_UTIL_PTHREAD_MUTEX_ATTR_H
3 
4 #include <pthread.h>
5 
6 
7 namespace carma {
8 namespace util {
9 
10 
13 
15  public:
16 
20 
21  explicit PthreadMutexAttr( );
22 
23 
27 
28  explicit PthreadMutexAttr( int type );
29 
30 
36 
37  virtual ~PthreadMutexAttr( );
38 
39 
49 
50  const ::pthread_mutexattr_t & InternalPthreadMutexAttr( ) const;
51 
52 
62 
63  ::pthread_mutexattr_t & InternalPthreadMutexAttr( );
64 
65 
66  private:
67  // no copying
68  PthreadMutexAttr( const PthreadMutexAttr & rhs );
69  PthreadMutexAttr & operator=( const PthreadMutexAttr & rhs );
70 
71  ::pthread_mutexattr_t mutexAttr_;
72 };
73 
74 
75 } // namespace carma::util
76 } // namespace carma
77 
78 
79 inline const ::pthread_mutexattr_t &
81 {
82  return mutexAttr_;
83 }
84 
85 
86 inline ::pthread_mutexattr_t &
88 {
89  return mutexAttr_;
90 }
91 
92 
93 #endif
PthreadMutexAttr()
Construct mutex attributes with the CARMA defaults.
virtual ~PthreadMutexAttr()
Destruct mutex attributes.
const ::pthread_mutexattr_t & InternalPthreadMutexAttr() const
Obtain a reference to the internal ::pthread_mutexattr_t.
A simple wrapper class that makes use of ::pthread_mutexattr_t easier in a C++ world.