Author: spetreolle
Date: Sat Jan 30 17:01:04 2016
New Revision: 70662
URL:
http://svn.reactos.org/svn/reactos?rev=70662&view=rev
Log:
[TASKMGR]
protect some variables with the critical section
Patch by Mark Jansen.
CORE-10787
Modified:
trunk/reactos/base/applications/taskmgr/perfdata.c
Modified: trunk/reactos/base/applications/taskmgr/perfdata.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/taskmgr/…
==============================================================================
--- trunk/reactos/base/applications/taskmgr/perfdata.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/taskmgr/perfdata.c [iso-8859-1] Sat Jan 30 17:01:04
2016
@@ -477,17 +477,29 @@
ULONG PerfDataGetProcessCount(void)
{
- return ProcessCount;
+ ULONG Result;
+ EnterCriticalSection(&PerfDataCriticalSection);
+ Result = ProcessCount;
+ LeaveCriticalSection(&PerfDataCriticalSection);
+ return Result;
}
ULONG PerfDataGetProcessorUsage(void)
{
- return (ULONG)dbIdleTime;
+ ULONG Result;
+ EnterCriticalSection(&PerfDataCriticalSection);
+ Result = (ULONG)dbIdleTime;
+ LeaveCriticalSection(&PerfDataCriticalSection);
+ return Result;
}
ULONG PerfDataGetProcessorSystemUsage(void)
{
- return (ULONG)dbKernelTime;
+ ULONG Result;
+ EnterCriticalSection(&PerfDataCriticalSection);
+ Result = (ULONG)dbKernelTime;
+ LeaveCriticalSection(&PerfDataCriticalSection);
+ return Result;
}
BOOL PerfDataGetImageName(ULONG Index, LPWSTR lpImageName, ULONG nMaxCount)