Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Latest commit

 

History

History
30 lines (20 loc) · 833 Bytes

095 ConcurrentQueue.TryPeek can return an erroneous null via its out parameter.md

File metadata and controls

30 lines (20 loc) · 833 Bytes

95: ConcurrentQueue<T>.TryPeek can return an erroneous null via its out parameter

Scope

Major

Version Introduced

4.5

Version Reverted

4.5.1

Source Analyzer Status

Available

Change Description

In some multi-threaded scenarios, ConcurrentQueue<T>.TryPeek can return true, but populate the out parameter with a null value (instead of the correct, peeked value).

  • Quirked
  • Build-time break

Recommended Action

This issue is fixed in the .NET Framework 4.5.1. Upgrading to that Framework will solve the issue.

Affected APIs

  • M:System.Collections.Concurrent.ConcurrentQueue`1.TryPeek(`0@)

Category

Core

More information