Esempio n. 1
0
        private void importClothPics(Object obj)
        {
            ImportArgus   argus    = (ImportArgus)obj;
            List <String> picNames = argus.PicNames;

            // show progress win
            argus.BefDel(picNames.Count);

            Queue picNameQueue = Queue.Synchronized(new Queue(picNames));

            // finished pictures
            //nFinished = 0;

            ParameterizedThreadStart threadDelegate = new ParameterizedThreadStart(importClothPicThread);

            Thread[] threads = new Thread[argus.ThreadNum];
            bool     isGabor = (argus.ThreadNum == 1);

            for (int i = 0; i < threads.Length; ++i)
            {
                threads[i] = new Thread(threadDelegate);
                threads[i].IsBackground = true;
                threads[i].Priority     = ThreadPriority.BelowNormal;
                threads[i].Start(new ImportThreadArgus(picNameQueue, argus.Step, argus.StopImport, argus.StepDel, isGabor));
            }

            for (int i = 0; i < threads.Length; ++i)
            {
                threads[i].Join();
            }

            argus.AfterDel();
        }