Posted 17 years ago
by Erik Pepping
-
RADVenture B.V
Version: 4.0.0262
Platform: .NET 2.0
Environment: Windows XP (32-bit)
Hi,
I think there might be a problem (lock/thread) with IsBusy since it's not return TRUE after calling LoadForCode.
Note: When using LoadForCode we don't get a SemanticParserServiceRequest so we can't use SemanticParserService.WaitForParse( parseHashKey).As you can image I am getting the exception "How can it be now busy?" and , IMHO makes no sense... Is there another way to wait?
NOTE (Extra information) : It seems that it does not happen so easily in real double core processor (or maybe it's just faster and then it's not so easily to notice). The fact is that the same tests behaves differently according to the machine.
[Modified at 11/23/2007 06:43 AM]
I think there might be a problem (lock/thread) with IsBusy since it's not return TRUE after calling LoadForCode.
Note: When using LoadForCode we don't get a SemanticParserServiceRequest so we can't use SemanticParserService.WaitForParse( parseHashKey).
public void LoadFrom(string pSourceCode)
{
if (string.IsNullOrEmpty(pSourceCode)) throw new ArgumentNullException("pSourceCode");
DotNetProjectResolver resolver = CreateDotNetProjectResolver();
if (resolver == null) throw new Exception("Project resolver could not be created");
resolver.SourceProjectContent.Clear();
resolver.SourceProjectContent.LoadForCode(new CSharpSyntaxLanguage(), "test", pSourceCode);
while (SemanticParserService.IsBusy || SemanticParserService.PendingRequestCount >0)
{
Debug.WriteLine("Sleeping..");
System.Threading.Thread.Sleep(600);
}
ICollection types = resolver.SourceProjectContent.GetTypesForSourceKey("test",false);
if (types == null || types.Count == 0)
{
if (SemanticParserService.IsBusy)
throw new Exception("How can it be now busy??");
throw new Exception("Load Failed");
}
NOTE (Extra information) : It seems that it does not happen so easily in real double core processor (or maybe it's just faster and then it's not so easily to notice). The fact is that the same tests behaves differently according to the machine.
[Modified at 11/23/2007 06:43 AM]