diff options
Diffstat (limited to 'core/safe_refcount.cpp')
-rw-r--r-- | core/safe_refcount.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/safe_refcount.cpp b/core/safe_refcount.cpp index 7718e466f2..9736f96f34 100644 --- a/core/safe_refcount.cpp +++ b/core/safe_refcount.cpp @@ -40,9 +40,9 @@ long atomic_conditional_increment( register long * pw ) { while (true) { long tmp = static_cast< long const volatile& >( *pw ); - if( tmp == 0 ) + if( tmp == 0 ) return 0; // if zero, can't add to it anymore - if( InterlockedCompareExchange( pw, tmp + 1, tmp ) == tmp ) + if( InterlockedCompareExchange( pw, tmp + 1, tmp ) == tmp ) return tmp+1; } |