SUMO - Simulation of Urban MObility
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
MFXMutex.h
Go to the documentation of this file.
1
/****************************************************************************/
9
//
10
/****************************************************************************/
11
// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12
// Copyright (C) 2007-2016 DLR (http://www.dlr.de/) and contributors
13
/****************************************************************************/
14
//
15
// This file is part of SUMO.
16
// SUMO is free software: you can redistribute it and/or modify
17
// it under the terms of the GNU General Public License as published by
18
// the Free Software Foundation, either version 3 of the License, or
19
// (at your option) any later version.
20
//
21
/****************************************************************************/
22
23
24
#ifndef MFXMUTEX_H
25
#define MFXMUTEX_H
26
27
28
// ===========================================================================
29
// included modules
30
// ===========================================================================
31
#ifdef _MSC_VER
32
#include <
windows_config.h
>
33
#else
34
#include <
config.h
>
35
#endif
36
37
#include <fx.h>
38
#include <
utils/common/AbstractMutex.h
>
39
40
#ifndef WIN32
41
typedef
void
*
FXThreadMutex
;
// handle to a mutex
42
#else
43
#define NOMINMAX
44
#include <windows.h>
45
#undef NOMINMAX
46
typedef
HANDLE
FXThreadMutex
;
// handle to a mutex
47
#endif
48
49
50
51
56
class
MFXMutex
:
public
AbstractMutex
{
57
public
:
59
MFXMutex
();
60
62
void
lock
();
63
65
void
unlock
();
66
68
virtual
~MFXMutex
();
69
70
inline
FXbool
locked
() {
71
return
lock_
? TRUE : FALSE;
72
}
73
74
protected
:
75
FXuint
lock_
;
// lock count
76
77
private
:
78
FXThreadMutex
mutexHandle
;
79
80
private
:
81
// dummy copy constructor and operator= to prevent copying
82
MFXMutex
(
const
MFXMutex
&);
83
MFXMutex
&
operator=
(
const
MFXMutex
&);
84
85
};
86
87
#endif // FXMUTEX_H
MFXMutex::lock_
FXuint lock_
Definition:
MFXMutex.h:75
windows_config.h
MFXMutex::operator=
MFXMutex & operator=(const MFXMutex &)
config.h
AbstractMutex
An abstract class for encapsulating mutex implementations.
Definition:
AbstractMutex.h:49
MFXMutex::mutexHandle
FXThreadMutex mutexHandle
Definition:
MFXMutex.h:78
FXThreadMutex
void * FXThreadMutex
Definition:
MFXMutex.h:41
MFXMutex::~MFXMutex
virtual ~MFXMutex()
dtor
Definition:
MFXMutex.cpp:72
MFXMutex::unlock
void unlock()
release mutex lock
Definition:
MFXMutex.cpp:96
MFXMutex
Definition:
MFXMutex.h:56
MFXMutex::lock
void lock()
lock mutex
Definition:
MFXMutex.cpp:86
AbstractMutex.h
MFXMutex::locked
FXbool locked()
Definition:
MFXMutex.h:70
MFXMutex::MFXMutex
MFXMutex()
create me a mutex :-)
Definition:
MFXMutex.cpp:50
src
utils
foxtools
MFXMutex.h
Generated on Sun Mar 19 2017 15:07:37 for SUMO - Simulation of Urban MObility by
1.8.8