From 2a45adcb40ae90040b6834f891a89ef92cadae22 Mon Sep 17 00:00:00 2001 From: heck Date: Mon, 28 Feb 2022 23:27:17 +0100 Subject: [PATCH] Moved: module 'call_with_lock' to libpEpCxx11 --- src/call_with_lock.cc | 8 -------- src/call_with_lock.hh | 26 -------------------------- 2 files changed, 34 deletions(-) delete mode 100644 src/call_with_lock.cc delete mode 100644 src/call_with_lock.hh diff --git a/src/call_with_lock.cc b/src/call_with_lock.cc deleted file mode 100644 index 82a9c49..0000000 --- a/src/call_with_lock.cc +++ /dev/null @@ -1,8 +0,0 @@ -// This file is under GNU General Public License 3.0 -// see LICENSE.txt - -#include "call_with_lock.hh" - -namespace pEp { - std::mutex call_with_lock_mutex; -} diff --git a/src/call_with_lock.hh b/src/call_with_lock.hh deleted file mode 100644 index 7e38dae..0000000 --- a/src/call_with_lock.hh +++ /dev/null @@ -1,26 +0,0 @@ -// This file is under GNU General Public License 3.0 -// see LICENSE.txt - -#ifndef LIBPEPADAPTER_CALL_WITH_LOCK_HH -#define LIBPEPADAPTER_CALL_WITH_LOCK_HH - -#include - -namespace pEp { - extern std::mutex call_with_lock_mutex; - - // TODO: use && and std::forward<> to avoid copying of the arguments. - // It is not relevant, yet, because at the moment we use this function - // template only for init() and release() which have cheap-to-copy pointer - // parameters only - template - R call_with_lock(R (*fn)(Args...), Args... args) - { - std::lock_guard L(call_with_lock_mutex); - return fn(args...); - } - - -} // namespace pEp - -#endif // LIBPEPADAPTER_CALL_WITH_LOCK_HH