Fawkes API
Fawkes Development Version
mutex.h
1
2
/***************************************************************************
3
* mutex.h - Mutex
4
*
5
* Generated: Thu Sep 14 16:58:49 2006
6
* Copyright 2006 Tim Niemueller [www.niemueller.de]
7
*
8
****************************************************************************/
9
10
/* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version. A runtime exception applies to
14
* this software (see LICENSE.GPL_WRE file mentioned below for details).
15
*
16
* This program is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU Library General Public License for more details.
20
*
21
* Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22
*/
23
24
#ifndef _CORE_THREADING_MUTEX_H_
25
#define _CORE_THREADING_MUTEX_H_
26
27
namespace
fawkes
{
28
29
class
MutexData;
30
class
WaitCondition;
31
32
class
Mutex
33
{
34
friend
WaitCondition;
35
36
public
:
37
/** Mutex type. */
38
typedef
enum
{
39
NORMAL
,
///< This type of mutex does not detect deadlock.
40
RECURSIVE
///< A thread attempting to relock this mutex without
41
///< first unlocking it shall succeed in locking the mutex.
42
}
Type
;
43
44
Mutex
(
Type
type =
NORMAL
);
45
~Mutex
();
46
47
void
lock
();
48
bool
try_lock
();
49
void
unlock
();
50
51
void
stopby
();
52
53
private
:
54
MutexData *mutex_data;
55
};
56
57
}
// end namespace fawkes
58
59
#endif
fawkes::Mutex::lock
void lock()
Lock this mutex.
Definition:
mutex.cpp:91
fawkes::Mutex::RECURSIVE
A thread attempting to relock this mutex without first unlocking it shall succeed in locking the mute...
Definition:
mutex.h:44
fawkes::Mutex::Type
Type
Mutex type.
Definition:
mutex.h:42
fawkes::Mutex::unlock
void unlock()
Unlock the mutex.
Definition:
mutex.cpp:135
fawkes
fawkes::Mutex::stopby
void stopby()
Shortly stop by at the mutex.
Definition:
mutex.cpp:154
fawkes::Mutex::Mutex
Mutex(Type type=NORMAL)
Constructor.
Definition:
mutex.cpp:63
fawkes::Mutex::NORMAL
This type of mutex does not detect deadlock.
Definition:
mutex.h:43
fawkes::Mutex::try_lock
bool try_lock()
Tries to lock the mutex.
Definition:
mutex.cpp:121
fawkes::Mutex::~Mutex
~Mutex()
Destructor.
Definition:
mutex.cpp:79
src
libs
core
threading
mutex.h
Generated by
1.8.16