atomic.h 1.1 KB

1234567891011121314151617181920212223242526272829
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Copyright (c) Electronic Arts Inc. All rights reserved.
  3. ///////////////////////////////////////////////////////////////////////////////
  4. #ifndef EATHREAD_INTERNAL_ATOMIC_H
  5. #define EATHREAD_INTERNAL_ATOMIC_H
  6. #if defined(EA_PRAGMA_ONCE_SUPPORTED)
  7. #pragma once // Some compilers (e.g. VC++) benefit significantly from using this. We've measured 3-4% build speed improvements in apps as a result.
  8. #endif
  9. namespace EA
  10. {
  11. namespace Thread
  12. {
  13. typedef int64_t(*AtomicAdd64Function)(volatile int64_t *ptr, int64_t value);
  14. typedef int64_t(*AtomicGetValue64Function)(volatile int64_t *ptr);
  15. typedef int64_t(*AtomicSetValue64Function)(volatile int64_t *ptr, int64_t value);
  16. typedef bool(*AtomicSetValueConditional64Function)(volatile int64_t *ptr, int64_t value, int64_t condition);
  17. extern AtomicAdd64Function AtomicAdd64;
  18. extern AtomicGetValue64Function AtomicGetValue64;
  19. extern AtomicSetValue64Function AtomicSetValue64;
  20. extern AtomicSetValueConditional64Function AtomicSetValueConditional64;
  21. }
  22. }
  23. #endif