cisst-saw
Loading...
Searching...
No Matches
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
14This software is provided "as is" under an open source license, with
15no warranty. The complete license can be found in license.txt and
16http://www.cisst.org/cisst/license.txt.
17
18--- end cisst license ---
19*/
20
21
27
28#ifndef _osaMutex_h
29#define _osaMutex_h
30
34
35struct osaMutexInternals;
36
49
51 osaMutexInternals * Internals;
52
54 osaThreadId LockerId;
55
56 bool Locked;
57
58public:
59 /* Enum type representing a timeout period of infinity and no wait. */
65 };
66
68#if 0 // MJ: obsoleted
69 enum ReturnType {
70 LOCK_FAILED,
71 SUCCESS,
72 TIMED_OUT
73 };
74#endif
75
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
120};
121
122
123#endif // _osaMutex_h
124
TimeoutType
Definition osaMutex.h:60
@ WAIT_FOREVER
Definition osaMutex.h:61
@ NO_WAIT
Definition osaMutex.h:63
void Unlock(void)
LockStateType GetLockState(void) const
osaMutex(void)
~osaMutex(void)
LockStateType
Definition osaMutex.h:77
@ UNLOCKED
Definition osaMutex.h:79
@ LOCKED
Definition osaMutex.h:78
void Lock(void)
bool IsLocker(void) const
ThreadId type.
Definition osaThread.h:77
#define CISST_EXPORT
Definition cmnExportMacros.h:50
Portability across compilers and operating systems tools.
Macros to export the symbols of cisstOSAbstraction (in a Dll).
Declaration of osaThread.