funcmacro_atomic.h 1.0 KB

123456789101112131415161718192021222324252627
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: funcmacro_atomic.h
  3. // Purpose: Atomic Operation function and macro group docs
  4. // Author: wxWidgets team
  5. // Licence: wxWindows licence
  6. /////////////////////////////////////////////////////////////////////////////
  7. /**
  8. @defgroup group_funcmacro_atomic Atomic Operations
  9. @ingroup group_funcmacro
  10. When using multi-threaded applications, it is often required to access or
  11. modify memory which is shared between threads. Atomic integer and pointer
  12. operations are an efficient way to handle this issue (another, less efficient,
  13. way is to use a wxMutex or wxCriticalSection). A native implementation exists
  14. for Windows, Linux, Solaris and Mac OS X; for others, a wxCriticalSection is
  15. used to protect the data.
  16. One particular application is reference counting (used by so-called
  17. @ref group_class_smartpointers "smart pointers").
  18. You should define your variable with the type wxAtomicInt in order to apply
  19. atomic operations to it.
  20. */