atomic.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: atomic.h
  3. // Purpose: interface of global functions
  4. // Author: wxWidgets team
  5. // Licence: wxWindows licence
  6. /////////////////////////////////////////////////////////////////////////////
  7. // ============================================================================
  8. // Global functions/macros
  9. // ============================================================================
  10. /** @addtogroup group_funcmacro_atomic */
  11. //@{
  12. /**
  13. This function increments @a value in an atomic manner.
  14. Whenever possible wxWidgets provides an efficient, CPU-specific,
  15. implementation of this function. If such implementation is available, the
  16. symbol wxHAS_ATOMIC_OPS is defined. Otherwise this function still exists
  17. but is implemented in a generic way using a critical section which can be
  18. prohibitively expensive for use in performance-sensitive code.
  19. @header{wx/atomic.h}
  20. */
  21. void wxAtomicInc(wxAtomicInt& value);
  22. /**
  23. This function decrements value in an atomic manner.
  24. Returns 0 if value is 0 after decrement or any non-zero value (not
  25. necessarily equal to the value of the variable) otherwise.
  26. @see wxAtomicInc
  27. @header{wx/atomic.h}
  28. */
  29. wxInt32 wxAtomicDec(wxAtomicInt& value);
  30. //@}