diff -r aa2539c91954 -r 1c2bb2fc7c87 perfsrv/piprofiler/plugins/GeneralsPlugin/src/PriSamplerImpl.cpp --- a/perfsrv/piprofiler/plugins/GeneralsPlugin/src/PriSamplerImpl.cpp Fri Oct 08 14:56:39 2010 +0300 +++ b/perfsrv/piprofiler/plugins/GeneralsPlugin/src/PriSamplerImpl.cpp Tue Oct 26 16:20:32 2010 +0300 @@ -99,16 +99,21 @@ LOGTEXT("Processing threads..."); - DObjectCon& threads = *Kern::Containers()[EThread]; + DObjectCon* threads = Kern::Containers()[EThread]; + NKern::ThreadEnterCS(); // Prevent us from dying or suspending whilst holding a DMutex + threads->Wait(); // PRI trace variables this->iThreadCount = 0; this->iNewThreadCount = 0; - TInt totalThreadCount = threads.Count(); + TInt totalThreadCount = threads->Count(); for(TInt i=0;iSignal(); + NKern::ThreadLeaveCS(); // End of critical section + if(this->iThreadCount > 0 || this->iNewThreadCount > 0) { this->iProcessing = EStartingToProcess; @@ -143,7 +151,6 @@ { this->iProcessing = ENothingToProcess; } - return length; } else @@ -301,12 +308,17 @@ // clear all thread tags + NKern::ThreadEnterCS(); // Prevent us from dying or suspending whilst holding a DMutex DObjectCon* threads = Kern::Containers()[EThread]; + threads->Wait(); // Obtain the container mutex so the list does get changed under us + TInt totalThreadCount = threads->Count(); for(TInt i=0;iSignal(); + NKern::ThreadLeaveCS(); // End of critical section + }