public static void DoWork(string targetFile) { // ensure we have a ParseAttribute for this file //if (!ParseStatus.ContainsKey(targetFile)) //{ // ParseStatus.Add(targetFile, new ParseAttribute()); //} //ParseStatusController.EnsureExists(targetFile); //bool IsReparsing = false; //lock(_synchronizationParseStatus) { // IsReparsing = ParseStatus[targetFile].IsReparsing; //} if (ParseStatusController.IsReparsing(targetFile)) { // TODO what is this for? does it help with threading? (probably not) Thread.Sleep(50); } else { lock (_synchronizationParseStatus) { ParseStatus[targetFile].IsReparsing = true; } VerilogGlobals.ReparseWork(threadbuffer, threadFile); // TODO once reparsing is done in a thread, we need to tell the viewport to redraww the screen Thread.Sleep(10); } }
public static void DoWork(string targetFile) { // ensure we have a ParseAttribute for this file //if (!ParseStatus.ContainsKey(targetFile)) //{ // ParseStatus.Add(targetFile, new ParseAttribute()); //} //ParseStatusController.EnsureExists(targetFile); //bool IsReparsing = false; //lock(_synchronizationParseStatus) { // IsReparsing = ParseStatus[targetFile].IsReparsing; //} if (ParseStatusController.IsReparsing(targetFile)) { // TODO what is this for? does it help with threading? (probably not) System.Diagnostics.Debug.WriteLine("DoWork called while IsReparsing..."); Thread.Sleep(50); } else { lock (_synchronizationParseStatus) { ParseStatus[targetFile].IsReparsing = true; } //if ( 1==1 || (DateTime.Now - LastRefresh).TotalSeconds > 10) //{ // System.Diagnostics.Debug.WriteLine("BufferAttributes calling ReparseWork"); VerilogGlobals.ReparseWork(threadbuffer, threadFile); // LastRefresh = DateTime.Now; //} // TODO once reparsing is done in a thread, we need to tell the viewport to redraww the screen // does this redraw? // TheView.Selection.TextView.ViewScroller.ScrollViewportVerticallyByPixels(0); Thread.Sleep(10); } }