VTK  9.2.6
vtkAtomicMutex.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkAtomicMutex.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
27#ifndef vtkAtomicMutex_h
28#define vtkAtomicMutex_h
29
30#include "vtkCommonCoreModule.h" // For export macro
31#include <atomic> // For std::atomic
32
33class VTKCOMMONCORE_EXPORT vtkAtomicMutex
34{
35public:
36 // left public purposely to allow for copy construction
38 ~vtkAtomicMutex() = default;
41
43
50 void lock();
51 void unlock();
53private:
54 std::atomic_bool Locked;
55};
56
57#endif // vtkAtomicMutex_h
58// VTK-HeaderTest-Exclude: vtkAtomicMutex.h
mutual exclusion locking class using atomic operations
vtkAtomicMutex & operator=(const vtkAtomicMutex &other)
~vtkAtomicMutex()=default
void lock()
Lock/Unlock atomic operation.
vtkAtomicMutex(const vtkAtomicMutex &other)
void unlock()
Lock/Unlock atomic operation.