diff options
Diffstat (limited to 'contrib/llvm/tools/lldb/source/Utility/SharingPtr.cpp')
-rw-r--r-- | contrib/llvm/tools/lldb/source/Utility/SharingPtr.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/contrib/llvm/tools/lldb/source/Utility/SharingPtr.cpp b/contrib/llvm/tools/lldb/source/Utility/SharingPtr.cpp index f64d7e3..be237ce 100644 --- a/contrib/llvm/tools/lldb/source/Utility/SharingPtr.cpp +++ b/contrib/llvm/tools/lldb/source/Utility/SharingPtr.cpp @@ -138,13 +138,21 @@ namespace imp void shared_count::add_shared() { - increment(shared_owners_); +#ifdef _MSC_VER + _InterlockedIncrement(&shared_owners_); +#else + ++shared_owners_; +#endif } void shared_count::release_shared() { - if (decrement(shared_owners_) == -1) +#ifdef _MSC_VER + if (_InterlockedDecrement(&shared_owners_) == -1) +#else + if (--shared_owners_ == -1) +#endif { on_zero_shared(); delete this; |