diff options
| author | Hubert Jarosz | 2016-03-09 00:00:52 +0100 |
|---|---|---|
| committer | Hubert Jarosz | 2016-03-09 00:00:52 +0100 |
| commit | 4a4f2479146aa33e235ed57cde311efda68d3c8f (patch) | |
| tree | cf91f2869ff8f058c6682569fb31e22e5ee736ad /core/safe_refcount.cpp | |
| parent | 1dad6eca812e5c2e313b54265114de8a1d73d999 (diff) | |
| download | godot-4a4f2479146aa33e235ed57cde311efda68d3c8f.tar.gz godot-4a4f2479146aa33e235ed57cde311efda68d3c8f.tar.zst godot-4a4f2479146aa33e235ed57cde311efda68d3c8f.zip | |
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 7718e466f..9736f96f3 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; } |
