CCF
Loading...
Searching...
No Matches
locking.h
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the Apache 2.0 License.
3#pragma once
4
5#if !defined(INSIDE_ENCLAVE) || defined(VIRTUAL_ENCLAVE)
6# include <mutex>
7#else
8# include <openenclave/3rdparty/libc/pthread.h>
9# include <openenclave/edger8r/enclave.h> // For oe_lfence
10#endif
11
12namespace ccf::pal
13{
17 using Mutex = std::mutex;
18
19#if !defined(INSIDE_ENCLAVE) || defined(VIRTUAL_ENCLAVE)
20 static inline void speculation_barrier() {}
21#else
22 static inline void speculation_barrier()
23 {
24 oe_lfence();
25 }
26#endif
27}
Definition attestation.h:28
std::mutex Mutex
Definition locking.h:17