Files
INS-VN-200/vnproglib/cpp/include/vn/criticalsection.h
r.koeppe 2d22ccd2d6 initial
2024-05-14 02:14:13 +02:00

53 lines
1.1 KiB
C++

/// \file
/// {COMMON_HEADER}
///
/// \section DESCRIPTION
/// This header file provides the class CriticalSection.
#ifndef _VNXPLAT_CRITICALSECTION_H_
#define _VNXPLAT_CRITICALSECTION_H_
#include "nocopy.h"
#include "export.h"
namespace vn {
namespace xplat {
/// \brief Represents a cross-platform critical section.
class vn_proglib_DLLEXPORT CriticalSection : private util::NoCopy
{
// Constructors ///////////////////////////////////////////////////////////
public:
/// \brief Creates a new critical section.
CriticalSection();
~CriticalSection();
// Public Methods /////////////////////////////////////////////////////////
public:
/// \brief Requests and signals that a critical section is being entered.
void enter();
/// \brief Signals that a critical section is being left.
void leave();
// Private Members ////////////////////////////////////////////////////////
private:
// Contains internal data, mainly stuff that is required for cross-platform
// support.
struct Impl;
Impl *_pi;
};
}
}
#endif