Run Code
|
Code Wall
|
Users
|
Misc
|
Feedback
|
About
|
Login
|
Theme
|
Privacy
IEnumerable visibility of bag
//Title of this code //Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Threading.Tasks; using System.Threading; using System.Collections.Concurrent; namespace Rextester { public class Program { public static void Main(string[] args) { //Your code goes here ConcurrentBag<int> bag = new ConcurrentBag<int>(); Task.Run(()=> { bag.Add(42); Thread.Sleep(1000); bag.Add(21); }); Task.Run(()=> { foreach(int i in bag) Console.WriteLine(i); }).Wait(); } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Lambdas
Collection_ Introduction default constructor rule_accessing methods from object returned from property
ö2
Bubble Sort
pointoncircle
generic stack implementation
Qwe
Anq Calc
Fórum ➡ Prime numbers implemented using LINQ statements AND using FOR loop ♦
Can a == true && a == false be true in C#?
Please log in to post a comment.