7 #ifndef BOTAN_UTIL_MUTEX_H__
8 #define BOTAN_UTIL_MUTEX_H__
10 #include <botan/build.h>
11 #include <botan/types.h>
13 #if defined(BOTAN_TARGET_OS_HAS_THREADS)
19 template<
typename T>
using lock_guard_type = std::lock_guard<T>;
20 typedef std::mutex mutex_type;
24 #elif defined(BOTAN_TARGET_OS_TYPE_IS_UNIKERNEL)
30 template<
typename Mutex>
34 explicit lock_guard(Mutex& m) : m_mutex(m)
37 ~lock_guard() { m_mutex.unlock(); }
39 lock_guard(
const lock_guard& other) =
delete;
40 lock_guard& operator=(
const lock_guard& other) =
delete;
52 typedef noop_mutex mutex_type;
53 template<
typename T>
using lock_guard_type = lock_guard<T>;
58 #error "Threads unexpectedly disabled in non unikernel build"
std::vector< T > unlock(const secure_vector< T > &in)