cheshirekow  v0.1.0
mutex_attr.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 Josh Bialkowski (jbialk@mit.edu)
3  *
4  * This file is part of cpp-pthreads.
5  *
6  * cpp-pthreads is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * cpp-pthreads is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with cpp-pthreads. If not, see <http://www.gnu.org/licenses/>.
18  */
27 #ifndef CPP_PTHREADS_MUTEXATTR_H_
28 #define CPP_PTHREADS_MUTEXATTR_H_
29 
30 #include <pthread.h>
31 
32 #include <cstdarg>
33 #include <ctime>
34 
35 #include <cpp_pthreads/attr.h>
36 #include <cpp_pthreads/enums.h>
37 #include <cpp_pthreads/mutex.h>
38 
39 namespace pthreads {
40 
44 
47 
50 
53 
55 extern const Access<Mutex, Type> TYPE;
56 
59 template<>
60 struct AttrType<Mutex> {
61  typedef pthread_mutexattr_t type;
62 };
63 
64 } // namespace pthreads
65 
66 #endif // MUTEXATTR_H_
const Access< Mutex, Type > TYPE
provides access to the type field of a pthread_mutexattr_t
TypeWrap< int, 0 > PriorityCeiling
A unique type which acts just like an int but is distinct in the eyes of the compiler.
Definition: mutex_attr.h:43
template used to resolve the pthreads_xxx_t object corresponding to the Attr<Base> object ...
Definition: attr.h:42
const Access< Mutex, PShared > M_PSHARED
provides access to the pshared field of a pthread_mutexattr_t
const Access< Mutex, PriorityCeiling > PRIORITY_CEILING
provides access to the prioceil field of a pthread_mutexattr_t
pthread_mutexattr_t type
Definition: mutex_attr.h:61
Provides a unique type that acts like a native type.
Definition: attr.h:261
a mutual exclusion lock
Definition: mutex.h:85
const Access< Mutex, Protocol > PROTOCOL
provides access to the protocol field of a pthread_mutexattr_t
access delegate, an object which can access an attribute value of an attribute object ...
Definition: attr.h:37