freebsd-dev/include/llvm/System/Atomic.h

40 lines
1.2 KiB
C
Raw Normal View History

2009-06-02 17:52:33 +00:00
//===- llvm/System/Atomic.h - Atomic Operations -----------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file declares the llvm::sys atomic operations.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_SYSTEM_ATOMIC_H
#define LLVM_SYSTEM_ATOMIC_H
2009-11-04 14:58:56 +00:00
#include "llvm/System/DataTypes.h"
2009-06-02 17:52:33 +00:00
namespace llvm {
namespace sys {
void MemoryFence();
2009-12-15 18:09:07 +00:00
#ifdef _MSC_VER
typedef long cas_flag;
#else
2009-06-27 10:44:33 +00:00
typedef uint32_t cas_flag;
2009-12-15 18:09:07 +00:00
#endif
2009-06-27 10:44:33 +00:00
cas_flag CompareAndSwap(volatile cas_flag* ptr,
cas_flag new_value,
cas_flag old_value);
cas_flag AtomicIncrement(volatile cas_flag* ptr);
cas_flag AtomicDecrement(volatile cas_flag* ptr);
cas_flag AtomicAdd(volatile cas_flag* ptr, cas_flag val);
cas_flag AtomicMul(volatile cas_flag* ptr, cas_flag val);
cas_flag AtomicDiv(volatile cas_flag* ptr, cas_flag val);
2009-06-02 17:52:33 +00:00
}
}
#endif