Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.2 KiB

  1. //===- llvm/Support/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. #ifndef LLVM_SUPPORT_ATOMIC_H
  14. #define LLVM_SUPPORT_ATOMIC_H
  15. #include "llvm/Support/DataTypes.h"
  16. namespace llvm {
  17. namespace sys {
  18. void MemoryFence();
  19. #ifdef _MSC_VER
  20. typedef long cas_flag;
  21. #else
  22. typedef uint32_t cas_flag;
  23. #endif
  24. cas_flag CompareAndSwap(volatile cas_flag* ptr,
  25. cas_flag new_value,
  26. cas_flag old_value);
  27. cas_flag AtomicIncrement(volatile cas_flag* ptr);
  28. cas_flag AtomicDecrement(volatile cas_flag* ptr);
  29. cas_flag AtomicAdd(volatile cas_flag* ptr, cas_flag val);
  30. cas_flag AtomicMul(volatile cas_flag* ptr, cas_flag val);
  31. cas_flag AtomicDiv(volatile cas_flag* ptr, cas_flag val);
  32. }
  33. }
  34. #endif