예제 #1
0
        private void execute()
        {
            while (true)
            {
                DDirectoryParserItem parserItem = null;
                safeGetCountFunc  safeGetCount = delegate(){lock (directoriesToParse){return directoriesToParse.Count;}};

                List<ASTCollection> col = new List<ASTCollection>();
                while (safeGetCount() != 0)
                {
                    string currentDir = "";
                    lock (directoriesToParse){
                        parserItem = directoriesToParse.Dequeue();
                        currentDir = parserItem.Directory;
                    }

                    var ac = new ASTCollection(currentDir);
                    ac.UpdateFromBaseDirectory();
                    col.Add(ac);

                    if (col.Count != 0)
                    {
                        lock(parserItem.Storage){
                            parserItem.Storage.ParsedGlobalDictionaries.AddRange(col);
                        }
                    }
                }
                try	{Thread.Sleep(Timeout.Infinite);}
                catch (ThreadInterruptedException e)
                {/*do nothing*/ }
            }
        }
예제 #2
0
        private void execute()
        {
            while (true)
            {
                DDirectoryParserItem parserItem   = null;
                safeGetCountFunc     safeGetCount = delegate(){ lock (directoriesToParse){ return(directoriesToParse.Count); } };

                List <ASTCollection> col = new List <ASTCollection>();
                while (safeGetCount() != 0)
                {
                    string currentDir = "";
                    lock (directoriesToParse){
                        parserItem = directoriesToParse.Dequeue();
                        currentDir = parserItem.Directory;
                    }

                    var ac = new ASTCollection(currentDir);
                    ac.UpdateFromBaseDirectory();
                    col.Add(ac);

                    if (col.Count != 0)
                    {
                        lock (parserItem.Storage){
                            parserItem.Storage.ParsedGlobalDictionaries.AddRange(col);
                        }
                    }
                }
                try     { Thread.Sleep(Timeout.Infinite); }
                catch (ThreadInterruptedException e)
                { /*do nothing*/ }
            }
        }