Line data Source code
1 : /********************************************************************************
2 : * Copyright (c) 2026 BMW AG
3 : *
4 : * This program and the accompanying materials are made available under the
5 : * terms of the Apache License Version 2.0 which is available at
6 : * https://www.apache.org/licenses/LICENSE-2.0
7 : *
8 : * SPDX-License-Identifier: Apache-2.0
9 : ********************************************************************************/
10 :
11 : #include <middleware/concurrency/MemoryFences.h>
12 : #include <middleware/concurrency/SpinLock.h>
13 : #include <atomic>
14 :
15 : namespace middleware::concurrency
16 : {
17 0 : void spinLockOptimization() { asm volatile("pause" ::: "memory"); }
18 :
19 0 : void atomicThreadFence() { std::atomic_thread_fence(std::memory_order_acq_rel); }
20 : } // namespace middleware::concurrency
|