Skip to content

Commit d6b0173

Browse files
svickRon Petrusha
authored andcommitted
Remove bad Interlocked.Exchange example (dotnet#162)
* Removed bad Interlocked.Exchange example * Removed another bad Interlocked.Exchange example * Changed text to note
1 parent 46b0e04 commit d6b0173

File tree

1 file changed

+5
-24
lines changed

1 file changed

+5
-24
lines changed

xml/System.Threading/Interlocked.xml

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -952,18 +952,10 @@
952952
<remarks>
953953
<format type="text/markdown"><![CDATA[
954954
955-
## Remarks
956-
Beginning with .NET Framework version 2.0, the <xref:System.Threading.Interlocked.Exchange%60%601%28%60%600%40%2C%60%600%29> method overload provides a type-safe alternative for reference types.
957-
958-
959-
960-
## Examples
961-
The following code example shows the syntax for using `Exchange` with any reference type object.
962-
963-
[!code-cpp[System.Threading.Interlocked.Exchange#1](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Threading.Interlocked.Exchange/CPP/source.cpp#1)]
964-
[!code-csharp[System.Threading.Interlocked.Exchange#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Threading.Interlocked.Exchange/CS/source.cs#1)]
965-
[!code-vb[System.Threading.Interlocked.Exchange#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Threading.Interlocked.Exchange/VB/source.vb#1)]
966-
955+
## Remarks
956+
957+
> [!NOTE]
958+
> Beginning with .NET Framework version 2.0, the <xref:System.Threading.Interlocked.Exchange%60%601%28%60%600%40%2C%60%600%29> method overload provides a type-safe alternative for reference types.
967959
]]></format>
968960
</remarks>
969961
<exception cref="T:System.ArgumentNullException">The address of <paramref name="location1" /> is a null pointer.</exception>
@@ -1067,17 +1059,6 @@
10671059
10681060
> [!NOTE]
10691061
> This method overload is preferable to the <xref:System.Threading.Interlocked.Exchange%28System.Object%40%2CSystem.Object%29> method overload, because the latter requires late-bound access to the destination object .
1070-
1071-
1072-
1073-
## Examples
1074-
The following example launches ten tasks, each of which generates 100 ten-character part numbers. It then the part number that is first alphabetically.
1075-
1076-
[!code-csharp[System.Threading.Interlocked.Exchange#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Threading.Interlocked.Exchange/CS/Exchange5.cs#2)]
1077-
[!code-vb[System.Threading.Interlocked.Exchange#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Threading.Interlocked.Exchange/VB/Exchange5.vb#2)]
1078-
1079-
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 <xref:System.Threading.Interlocked.Exchange%2A> method to assign the new value to `firstWidget`.
1080-
10811062
]]></format>
10821063
</remarks>
10831064
<exception cref="T:System.NullReferenceException">The address of <paramref name="location1" /> is a null pointer.</exception>
@@ -1326,4 +1307,4 @@
13261307
</Docs>
13271308
</Member>
13281309
</Members>
1329-
</Type>
1310+
</Type>

0 commit comments

Comments
 (0)