diff options
author | Jan Kotas <jkotas@microsoft.com> | 2016-02-05 19:41:37 +0300 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2016-02-05 19:41:37 +0300 |
commit | 218282754c9b67d057a5e40e75673795ef43413f (patch) | |
tree | 5f611d34487c882a2569aaca6c25fb15e74ca423 /src/Native/Runtime/slist.inl | |
parent | 2996cac38fffe6a32120d86e486748b01af7f184 (diff) |
Delete obsoleted code
We have been keeping obsoleted code in the runtime for compatibility with older versions. The runtime version just got bumped up - it allows us to delete the obsolete code before the next compatibility band starts.
[tfs-changeset: 1572810]
Diffstat (limited to 'src/Native/Runtime/slist.inl')
-rw-r--r-- | src/Native/Runtime/slist.inl | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/src/Native/Runtime/slist.inl b/src/Native/Runtime/slist.inl index 6a3551058..0890a1733 100644 --- a/src/Native/Runtime/slist.inl +++ b/src/Native/Runtime/slist.inl @@ -120,51 +120,6 @@ typename SList<T, Traits>::PTR_T SList<T, Traits>::PopHead() return pRet; } -#ifdef FEATURE_VSD -//------------------------------------------------------------------------------------------------- -// This API is currently used only by VSD and it has a race condition. Possibly not worth fixing since it's -// hard and we may be getting rid of VSD entirely. -template <typename T, typename Traits> -inline -typename SList<T, Traits>::PTR_T SList<T, Traits>::PopHeadInterlocked() -{ - NO_DAC(); - ASSERT(IS_ALIGNED(&m_pHead, sizeof(void*))); - - T* pRetItem = NULL; - while (true) - { - // The read of m_pHead->m_pNext must be volatile to ensure the compiler reads - // the value only once. - pRetItem = *reinterpret_cast<T * volatile *>(&m_pHead); - - // It is impossible for - // pRetItem->m_pNext to be modified until the link is successfully removed from - // the list. If another thread beats us to the remove, then the interlocked operation - // will fail (since the value of m_pHead->m_pNext will have been updated by that thread's - // interlocked compare exchange), and we'll update pRetItem with the new value and - // try again, failing if there are no elements in the list. - - // The above logic has a flaw: we don't guard against the head element being popped, another element - // pushed and then the original element being re-pushed in between our initial read of the head - // element's next pointer and the interlocked compare exchange operation. Such a sequence would drop - // an element on the floor. The OS SLIST implementation uses a much more complex list head to avoid - // this problem and imposes double-pointer alignment requirements on both the list head and entries as - // a result. - - if (pRetItem == NULL || - PalInterlockedCompareExchangePointer( - reinterpret_cast<void * volatile *>(&m_pHead), - reinterpret_cast<void *>(*GetNextPtr(pRetItem)), - reinterpret_cast<void *>(pRetItem)) == reinterpret_cast<void *>(pRetItem)) - { - break; - } - } - return pRetItem; -} -#endif // FEATURE_VSD - //------------------------------------------------------------------------------------------------- template <typename T, typename Traits> inline |