acl  3.5.3.0
event_mutex.hpp
浏览该文件的文档.
1 #pragma once
2 #include "../acl_cpp_define.hpp"
3 #include "../stdlib/atomic.hpp"
4 #include "../stdlib/noncopyable.hpp"
5 
6 namespace acl
7 {
8 
10 {
11 public:
12  event_mutex(bool recursive = true);
13  ~event_mutex(void);
14 
15  bool lock(void);
16  bool unlock(void);
17 
18 private:
19  bool recursive_;
20  unsigned int nested_;
21 #if defined(_WIN32) || defined(_WIN64)
22  SOCKET in_;
23  SOCKET out_;
24 #else
25  int in_;
26  int out_;
27 #endif
28  atomic_long count_;
29  unsigned long tid_;
30 };
31 
32 } // namespace acl
#define ACL_CPP_API