cisst-saw
Toggle main menu visibility
Loading...
Searching...
No Matches
tmp
cisst-saw
cisst
cisstOSAbstraction
osaMutex.h
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3
4
/*
5
6
Author(s): Anton Deguet
7
Created on: 2008-01-30
8
9
(C) Copyright 2004-2012 Johns Hopkins University (JHU), All Rights
10
Reserved.
11
12
--- begin cisst license - do not edit ---
13
14
This software is provided "as is" under an open source license, with
15
no warranty. The complete license can be found in license.txt and
16
http://www.cisst.org/cisst/license.txt.
17
18
--- end cisst license ---
19
*/
20
21
27
28
#ifndef _osaMutex_h
29
#define _osaMutex_h
30
31
#include <
cisstCommon/cmnPortability.h
>
32
#include <
cisstOSAbstraction/osaThread.h
>
33
#include <
cisstOSAbstraction/osaExport.h
>
34
35
struct
osaMutexInternals;
36
48
class
CISST_EXPORT
osaMutex
{
49
51
osaMutexInternals * Internals;
52
54
osaThreadId
LockerId;
55
56
bool
Locked;
57
58
public
:
59
/* Enum type representing a timeout period of infinity and no wait. */
60
enum
TimeoutType
{
61
WAIT_FOREVER
= -1,
63
NO_WAIT
= 0
65
};
66
68
#if 0
// MJ: obsoleted
69
enum
ReturnType {
70
LOCK_FAILED,
71
SUCCESS,
72
TIMED_OUT
73
};
74
#endif
75
77
enum
LockStateType
{
78
LOCKED
,
79
UNLOCKED
80
};
81
83
osaMutex
(
void
);
84
86
~osaMutex
(
void
);
87
93
void
Lock
(
void
);
94
99
void
Unlock
(
void
);
100
113
//ReturnType TryLock(int timeout);
114
116
bool
IsLocker
(
void
)
const
;
117
119
LockStateType
GetLockState
(
void
)
const
;
120
};
121
122
123
#endif
// _osaMutex_h
124
osaMutex::TimeoutType
TimeoutType
Definition
osaMutex.h:60
osaMutex::WAIT_FOREVER
@ WAIT_FOREVER
Definition
osaMutex.h:61
osaMutex::NO_WAIT
@ NO_WAIT
Definition
osaMutex.h:63
osaMutex::Unlock
void Unlock(void)
osaMutex::GetLockState
LockStateType GetLockState(void) const
osaMutex::osaMutex
osaMutex(void)
osaMutex::~osaMutex
~osaMutex(void)
osaMutex::LockStateType
LockStateType
Definition
osaMutex.h:77
osaMutex::UNLOCKED
@ UNLOCKED
Definition
osaMutex.h:79
osaMutex::LOCKED
@ LOCKED
Definition
osaMutex.h:78
osaMutex::Lock
void Lock(void)
osaMutex::IsLocker
bool IsLocker(void) const
osaThreadId
ThreadId type.
Definition
osaThread.h:77
CISST_EXPORT
#define CISST_EXPORT
Definition
cmnExportMacros.h:50
cmnPortability.h
Portability across compilers and operating systems tools.
osaExport.h
Macros to export the symbols of cisstOSAbstraction (in a Dll).
osaThread.h
Declaration of osaThread.
Generated by
1.18.0