Пример #1
0
        private void ComputeHashSum()
        {
            string fullFilePath;
            bool   successed = stash.TryDequeue(out fullFilePath);

            if (successed)
            {
                if (verbose)
                {
                    PrintStageOfWork("dequeue", fullFilePath);
                }
                var result = HashFunction.ComputeMD5Checksum(fullFilePath);
                if (verbose)
                {
                    PrintStageOfWork("hashResult", result.ToStringShort());
                }
                results.Enqueue(result);
                results.Ready.Set();
            }
            else if (stash.IsProducering)
            {
                stash.Ready.WaitOne();
            }
            else
            {
                return;
            }
        }
Пример #2
0
 private void EnqueueFile(string targetFile)
 {
     stash.Enqueue(targetFile);
     stash.Ready.Set();
 }