adds two integers as an atomic operation
Published: 24. October 2011 | Updated: 26. October 2011License: Microsoft Public License (MS-PL)
Categories: Framework » Threading
Tags: C# Threading
Import namespace
using System.Threading;
Code
int i = 100; Interlocked.Add(ref i, 50); Console.WriteLine(i);Console Output:
150
| Send us feedback about this snippet » |





