define wxHAS_ATOMIC_OPS only if native implementation is available; use fewer loop iterations in the test if it isn't as otherwise the test takes way too long to run

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53954 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-06-02 20:42:23 +00:00
parent f60ca3e24c
commit 42124e683d
4 changed files with 53 additions and 28 deletions

View File

@@ -17,14 +17,23 @@
/**
This function increments @a value in an atomic manner.
Whenever possible wxWidgets provides an efficient, CPU-specific,
implementation of this function. If such implementation is available, the
symbol wxHAS_ATOMIC_OPS is defined. Otherwise this function still exists
but is implemented in a generic way using a critical section which can be
prohibitively expensive for use in performance-sensitive code.
@header{wx/atomic.h}
*/
void wxAtomicInc(wxAtomicInt& value);
/**
This function decrements value in an atomic manner. Returns 0 if value is 0
after decrementation or any non-zero value (not necessarily equal to the
value of the variable) otherwise.
This function decrements value in an atomic manner.
Returns 0 if value is 0 after decrement or any non-zero value (not
necessarily equal to the value of the variable) otherwise.
@see wxAtomicInc
@header{wx/atomic.h}
*/