f90a8f62e1c76dd8ce07b1002f1b16e3df9ec251
[oota-llvm.git] / include / llvm / System / Atomic.h
1 //===- llvm/System/Atomic.h - Atomic Operations -----------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file declares the llvm::sys atomic operations.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_SYSTEM_ATOMIC_H
15 #define LLVM_SYSTEM_ATOMIC_H
16
17 #include "llvm/Support/DataTypes.h"
18
19 namespace llvm {
20   namespace sys {
21     void MemoryFence();
22
23     typedef uint32_t cas_flag;
24     cas_flag CompareAndSwap(volatile cas_flag* ptr,
25                             cas_flag new_value,
26                             cas_flag old_value);
27     cas_flag AtomicPostIncrement(volatile cas_flag* ptr);
28     cas_flag AtomicPostDecrement(volatile cas_flag* ptr);
29   }
30 }
31
32 #endif