mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 05:13:58 +00:00
Format all C++ and Java code via clang-format
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
@@ -26,16 +26,16 @@ public:
|
||||
return m_engine != nullptr;
|
||||
}
|
||||
|
||||
template <typename Function, typename ... Args>
|
||||
void SafeCall(Function && f, Args && ... functionArgs)
|
||||
template <typename Function, typename... Args>
|
||||
void SafeCall(Function && f, Args &&... functionArgs)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
if (m_engine != nullptr)
|
||||
(m_engine.get()->*f)(std::forward<Args>(functionArgs)...);
|
||||
}
|
||||
|
||||
template <typename Function, typename ... Args>
|
||||
dp::DrapeID SafeCallWithResult(Function && f, Args && ... functionArgs)
|
||||
template <typename Function, typename... Args>
|
||||
dp::DrapeID SafeCallWithResult(Function && f, Args &&... functionArgs)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
if (m_engine != nullptr)
|
||||
@@ -53,16 +53,9 @@ private:
|
||||
class DrapeEngineLockGuard
|
||||
{
|
||||
public:
|
||||
explicit DrapeEngineLockGuard(DrapeEngineSafePtr & enginePtr)
|
||||
: m_ptr(enginePtr)
|
||||
{
|
||||
m_ptr.m_mutex.lock();
|
||||
}
|
||||
explicit DrapeEngineLockGuard(DrapeEngineSafePtr & enginePtr) : m_ptr(enginePtr) { m_ptr.m_mutex.lock(); }
|
||||
|
||||
~DrapeEngineLockGuard()
|
||||
{
|
||||
m_ptr.m_mutex.unlock();
|
||||
}
|
||||
~DrapeEngineLockGuard() { m_ptr.m_mutex.unlock(); }
|
||||
|
||||
explicit operator bool() { return m_ptr.m_engine != nullptr; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user