[Monodevelop-patches-list] r856 - trunk/MonoDevelop/src/Main/Base/Services/ParserService
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Mon Feb 9 21:09:23 EST 2004
Author: benm
Date: 2004-02-09 21:09:23 -0500 (Mon, 09 Feb 2004)
New Revision: 856
Modified:
trunk/MonoDevelop/src/Main/Base/Services/ParserService/DefaultParserService.cs
Log:
workaround the thread problem
Modified: trunk/MonoDevelop/src/Main/Base/Services/ParserService/DefaultParserService.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Services/ParserService/DefaultParserService.cs 2004-02-10 01:54:43 UTC (rev 855)
+++ trunk/MonoDevelop/src/Main/Base/Services/ParserService/DefaultParserService.cs 2004-02-10 02:09:23 UTC (rev 856)
@@ -283,6 +283,15 @@
}
}
+ public override void UnloadService()
+ {
+ base.UnloadService ();
+ if (worker != null && worker.IsAlive) {
+ worker.Abort ();
+ worker = null;
+ }
+ }
+
public override void InitializeService()
{
parser = (IParser[])(AddInTreeSingleton.AddInTree.GetTreeNode("/Workspace/Parser").BuildChildItems(this)).ToArray(typeof(IParser));
@@ -364,12 +373,13 @@
}
}
+ Thread worker;
public void StartParserThread()
{
- Thread t = new Thread(new ThreadStart(ParserUpdateThread));
- t.IsBackground = true;
- t.Priority = ThreadPriority.Lowest;
- t.Start();
+ worker = new Thread(new ThreadStart(ParserUpdateThread));
+ worker.IsBackground = true;
+ worker.Priority = ThreadPriority.Lowest;
+ worker.Start();
}
void ParserUpdateThread()
More information about the Monodevelop-patches-list
mailing list