2008-03-14 01:47:17 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: funcmacro_atomic.h
|
|
|
|
// Purpose: Atomic Operation function and macro group docs
|
|
|
|
// Author: wxWidgets team
|
2010-07-13 09:29:13 -04:00
|
|
|
// Licence: wxWindows licence
|
2008-03-14 01:47:17 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
@defgroup group_funcmacro_atomic Atomic Operations
|
|
|
|
@ingroup group_funcmacro
|
|
|
|
|
|
|
|
When using multi-threaded applications, it is often required to access or
|
|
|
|
modify memory which is shared between threads. Atomic integer and pointer
|
|
|
|
operations are an efficient way to handle this issue (another, less efficient,
|
2008-03-19 04:02:01 -04:00
|
|
|
way is to use a wxMutex or wxCriticalSection). A native implementation exists
|
2016-02-04 03:54:36 -05:00
|
|
|
for Windows, Linux, Solaris and OS X; for others, a wxCriticalSection is
|
2008-03-19 04:02:01 -04:00
|
|
|
used to protect the data.
|
2008-03-14 01:47:17 -04:00
|
|
|
|
2008-03-19 04:02:01 -04:00
|
|
|
One particular application is reference counting (used by so-called
|
|
|
|
@ref group_class_smartpointers "smart pointers").
|
2008-03-14 01:47:17 -04:00
|
|
|
|
|
|
|
You should define your variable with the type wxAtomicInt in order to apply
|
|
|
|
atomic operations to it.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|