Samchon Framework for CPP  1.0.0
UniqueAcquire.hpp
1 #pragma once
2 #include <samchon/API.hpp>
3 
4 namespace samchon
5 {
6 namespace library
7 {
8  class Semaphore;
9 
41  class SAMCHON_FRAMEWORK_API UniqueAcquire
42  {
43  private:
48 
52  bool isLocked;
53 
54  public:
55  /* -----------------------------------------------------------
56  CONSTRUCTORS
57  ----------------------------------------------------------- */
64  UniqueAcquire(Semaphore &, bool = true);
65 
76  UniqueAcquire(const UniqueAcquire &) = delete;
77 
84 
89  ~UniqueAcquire();
90 
91  /* -----------------------------------------------------------
92  LOCKERS
93  ----------------------------------------------------------- */
97  void acquire();
98 
102  void release();
103 
107  //auto tryAcquire() -> bool;
108  };
109 };
110 };
bool isLocked
Whether the semaphore was acquired by the UniqueLock.
Unique acquire from a Semaphore.
Semaphore * semaphore
Managed semaphore.
Top level namespace of products built from samchon.
Definition: ByteArray.hpp:7