OpenSplice ISO C++ 2 FACE API  v6.x
OpenSplice Future Airborne Capability Environment (FACE) ISO C++ 2 API
Mutex.hpp
Go to the documentation of this file.
1 /*
2 * Vortex OpenSplice
3 *
4  * This software and documentation are Copyright 2006 to 2021 ADLINK
5  * Technology Limited, its affiliated companies and licensors. All rights
6  * reserved.
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19 *
20 */
21 #ifndef VORTEX_FACE_MUTEX_HPP_
22 #define VORTEX_FACE_MUTEX_HPP_
23 
24 #include "os_mutex.h"
25 #include "Vortex/FACE/Macros.hpp"
26 
27 namespace Vortex {
28 namespace FACE {
29 
31 {
32 public:
33  Mutex();
34  virtual ~Mutex();
35 
36  void lock() const;
37  bool try_lock() const;
38  void unlock() const;
39 private:
40  os_mutex mtx;
41 };
42 
43 
45 {
46 public:
47  MutexScoped(const Mutex& mutex);
48  ~MutexScoped();
49 
50 private:
51  const Mutex& mtx;
52 };
53 
54 }; /* namespace FACE */
55 }; /* namespace Vortex */
56 
57 
58 #endif /* VORTEX_FACE_MUTEX_HPP_ */
#define VORTEX_FACE_API
Definition: Macros.hpp:34