コード例 #1
0
ファイル: DIncludesParser.cs プロジェクト: nazriel/Mono-D
        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*/ }
            }
        }