mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-14 00:40:55 +08:00
9697f95b8f
This reverts commit 15d999759e
.
33 lines
545 B
C++
33 lines
545 B
C++
#pragma once
|
|
#include "../acl_cpp_define.hpp"
|
|
#include "../stdlib/atomic.hpp"
|
|
#include "../stdlib/noncopyable.hpp"
|
|
|
|
namespace acl
|
|
{
|
|
|
|
class ACL_CPP_API event_mutex : public noncopyable
|
|
{
|
|
public:
|
|
event_mutex(bool recursive = true);
|
|
~event_mutex(void);
|
|
|
|
bool lock(void);
|
|
bool unlock(void);
|
|
|
|
private:
|
|
bool recursive_;
|
|
unsigned int nested_;
|
|
#if defined(_WIN32) || defined(_WIN64)
|
|
SOCKET in_;
|
|
SOCKET out_;
|
|
#else
|
|
int in_;
|
|
int out_;
|
|
#endif
|
|
atomic_long count_;
|
|
unsigned long tid_;
|
|
};
|
|
|
|
} // namespace acl
|