diff options
author | Dmitry-Me <wipedout@yandex.ru> | 2016-01-22 11:43:35 +0300 |
---|---|---|
committer | Dmitry-Me <wipedout@yandex.ru> | 2016-01-22 11:43:35 +0300 |
commit | 952fdd33c45f053c21142f008716521328477efb (patch) | |
tree | cbd287a3f277e22431caad61cb8767a54e953f9b /src | |
parent | 431f7ff1150561a9d27e29c155706e279328446a (diff) | |
download | coreclr-952fdd33c45f053c21142f008716521328477efb.tar.gz coreclr-952fdd33c45f053c21142f008716521328477efb.tar.bz2 coreclr-952fdd33c45f053c21142f008716521328477efb.zip |
Non-interlocked read of variable after InterlockedDecrement() causes a race
Diffstat (limited to 'src')
-rw-r--r-- | src/debug/di/rspriv.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/debug/di/rspriv.h b/src/debug/di/rspriv.h index a89b17d49b..7238ffd787 100644 --- a/src/debug/di/rspriv.h +++ b/src/debug/di/rspriv.h @@ -1266,14 +1266,14 @@ public: LOG((LF_CORDB, LL_EVERYTHING, "Memory: CordbBase object deleted: this=%p, id=%p, Refcount=0x%x\n", this, m_id, m_RefCount)); #ifdef _DEBUG - InterlockedDecrement(&s_TotalObjectCount); - _ASSERTE(s_TotalObjectCount >= 0); + LONG newTotalObjectsCount = InterlockedDecrement(&s_TotalObjectCount); + _ASSERTE(newTotalObjectsCount >= 0); #endif // Don't shutdown logic until everybody is done with it. // If we leak objects, this may mean that we never shutdown logging at all! #if defined(_DEBUG) && defined(LOGGING) - if (s_TotalObjectCount == 0) + if (newTotalObjectsCount == 0) { ShutdownLogging(); } |