mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 07:27:45 +00:00
Kernel: Add safe atomic functions
This allows us to perform atomic operations on potentially unsafe user space pointers.
This commit is contained in:
parent
992f513ad2
commit
b17a889320
10 changed files with 573 additions and 166 deletions
|
@ -31,6 +31,11 @@
|
|||
|
||||
namespace AK {
|
||||
|
||||
static inline void atomic_thread_fence(MemoryOrder order) noexcept
|
||||
{
|
||||
return __atomic_thread_fence(order);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static inline T atomic_exchange(volatile T* var, T desired, MemoryOrder order = memory_order_seq_cst) noexcept
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue