1 //===- llvm/Support/Atomic.h - Atomic Operations -----------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares the llvm::sys atomic operations.
12 // DO NOT USE IN NEW CODE!
14 // New code should always rely on the std::atomic facilities in C++11.
16 //===----------------------------------------------------------------------===//
18 #ifndef LLVM_SUPPORT_ATOMIC_H
19 #define LLVM_SUPPORT_ATOMIC_H
21 #include "llvm/Support/DataTypes.h"
23 // Windows will at times define MemoryFence.
33 typedef long cas_flag;
35 typedef uint32_t cas_flag;
37 cas_flag CompareAndSwap(volatile cas_flag* ptr,