private Queue<string> m_Queue = new Queue<string>(); Thread threadRead = new Thread(() => Read(Collection, threadCount)); threadRead.Start(); private void Read(string[] Collection, int port) { while (true) { lock (m_SyncVar) { for (int j = 0; j < Collection.Length; j++) { for (int i = 0; i < port; i++) { m_Queue.Enqueue(Collection[j]); } } } } }
Queue.Enqueue
Queue.Count
System.Collections.Queue
System.Collections.Concurrent.BlockingCollection<T>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)