From 852f073c682b06fc6fb8c19dbfac75f0ae830348 Mon Sep 17 00:00:00 2001 From: Petr Onderka Date: Wed, 9 May 2018 13:01:46 +0200 Subject: [PATCH 1/3] Removed bad Interlocked.Exchange example --- xml/System.Threading/Interlocked.xml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/xml/System.Threading/Interlocked.xml b/xml/System.Threading/Interlocked.xml index 916eb6e18f9..9e142067d67 100644 --- a/xml/System.Threading/Interlocked.xml +++ b/xml/System.Threading/Interlocked.xml @@ -1067,17 +1067,6 @@ > [!NOTE] > This method overload is preferable to the method overload, because the latter requires late-bound access to the destination object . - - - -## Examples - The following example launches ten tasks, each of which generates 100 ten-character part numbers. It then the part number that is first alphabetically. - - [!code-csharp[System.Threading.Interlocked.Exchange#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Threading.Interlocked.Exchange/CS/Exchange5.cs#2)] - [!code-vb[System.Threading.Interlocked.Exchange#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Threading.Interlocked.Exchange/VB/Exchange5.vb#2)] - - The example uses the `firstWidget` variable to store the ID that occurs first in the sort order. It compares each ID that it generates with the `firstWidget` value. If the new value precedes the current value of `firstWidget` in the sort order, the example calls the method to assign the new value to `firstWidget`. - ]]> The address of is a null pointer. @@ -1326,4 +1315,4 @@ - \ No newline at end of file + From e09262521fcb375b6bac2a746dea3efb54d4cadc Mon Sep 17 00:00:00 2001 From: Petr Onderka Date: Wed, 9 May 2018 14:32:59 +0200 Subject: [PATCH 2/3] Removed another bad Interlocked.Exchange example --- xml/System.Threading/Interlocked.xml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/xml/System.Threading/Interlocked.xml b/xml/System.Threading/Interlocked.xml index 9e142067d67..602bd578e4e 100644 --- a/xml/System.Threading/Interlocked.xml +++ b/xml/System.Threading/Interlocked.xml @@ -954,16 +954,6 @@ ## Remarks Beginning with .NET Framework version 2.0, the method overload provides a type-safe alternative for reference types. - - - -## Examples - The following code example shows the syntax for using `Exchange` with any reference type object. - - [!code-cpp[System.Threading.Interlocked.Exchange#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Threading.Interlocked.Exchange/CPP/source.cpp#1)] - [!code-csharp[System.Threading.Interlocked.Exchange#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Threading.Interlocked.Exchange/CS/source.cs#1)] - [!code-vb[System.Threading.Interlocked.Exchange#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Threading.Interlocked.Exchange/VB/source.vb#1)] - ]]> The address of is a null pointer. From 26a8644c393691ab450f530417db8b907c1c4146 Mon Sep 17 00:00:00 2001 From: Petr Onderka Date: Thu, 10 May 2018 12:56:22 +0200 Subject: [PATCH 3/3] Changed text to note --- xml/System.Threading/Interlocked.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xml/System.Threading/Interlocked.xml b/xml/System.Threading/Interlocked.xml index 602bd578e4e..b2b7919e8ef 100644 --- a/xml/System.Threading/Interlocked.xml +++ b/xml/System.Threading/Interlocked.xml @@ -952,8 +952,10 @@ method overload provides a type-safe alternative for reference types. +## Remarks + +> [!NOTE] +> Beginning with .NET Framework version 2.0, the method overload provides a type-safe alternative for reference types. ]]> The address of is a null pointer.