mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 10:55:43 +00:00
refactor(Core/Tools): remove ACE from tools (#3351)
This commit is contained in:
16
src/common/Threading/PolicyLock.h
Normal file
16
src/common/Threading/PolicyLock.h
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-GPL2
|
||||
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#ifndef POLICYLOCK_H
|
||||
#define POLICYLOCK_H
|
||||
|
||||
#include <mutex>
|
||||
|
||||
#define RETURN_GUARD(mutex, retval) if (!mutex.try_lock()) \
|
||||
return retval; \
|
||||
std::lock_guard<decltype(mutex)> guard(mutex, std::adopt_lock)
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user