mirror of
https://github.com/reactos/CMake.git
synced 2024-12-06 18:57:10 +00:00
utility: Disabled copy ctors in thread classes
This commit is contained in:
parent
5def40891f
commit
b56b51fcaf
@ -9,6 +9,7 @@
|
|||||||
namespace cm {
|
namespace cm {
|
||||||
class mutex
|
class mutex
|
||||||
{
|
{
|
||||||
|
CM_DISABLE_COPY(mutex)
|
||||||
uv_mutex_t _M_;
|
uv_mutex_t _M_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -24,6 +25,7 @@ template <typename T>
|
|||||||
class lock_guard
|
class lock_guard
|
||||||
{
|
{
|
||||||
T& _mutex;
|
T& _mutex;
|
||||||
|
CM_DISABLE_COPY(lock_guard)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
lock_guard(T& m)
|
lock_guard(T& m)
|
||||||
@ -37,6 +39,7 @@ public:
|
|||||||
class shared_mutex
|
class shared_mutex
|
||||||
{
|
{
|
||||||
uv_rwlock_t _M_;
|
uv_rwlock_t _M_;
|
||||||
|
CM_DISABLE_COPY(shared_mutex)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
shared_mutex() { uv_rwlock_init(&_M_); }
|
shared_mutex() { uv_rwlock_init(&_M_); }
|
||||||
@ -55,6 +58,7 @@ template <typename T>
|
|||||||
class shared_lock
|
class shared_lock
|
||||||
{
|
{
|
||||||
T& _mutex;
|
T& _mutex;
|
||||||
|
CM_DISABLE_COPY(shared_lock)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
shared_lock(T& m)
|
shared_lock(T& m)
|
||||||
@ -68,6 +72,8 @@ public:
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
class unique_lock : public lock_guard<T>
|
class unique_lock : public lock_guard<T>
|
||||||
{
|
{
|
||||||
|
CM_DISABLE_COPY(unique_lock)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
unique_lock(T& m)
|
unique_lock(T& m)
|
||||||
: lock_guard<T>(m)
|
: lock_guard<T>(m)
|
||||||
|
Loading…
Reference in New Issue
Block a user