Author: mnordell
Date: Wed Oct 24 17:33:19 2007
New Revision: 29853
URL:
http://svn.reactos.org/svn/reactos?rev=29853&view=rev
Log:
Interlocked add/sub for quota. Still disabled code.
Modified:
trunk/reactos/ntoskrnl/ps/quota.c
Modified: trunk/reactos/ntoskrnl/ps/quota.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/quota.c?rev=29…
==============================================================================
--- trunk/reactos/ntoskrnl/ps/quota.c (original)
+++ trunk/reactos/ntoskrnl/ps/quota.c Wed Oct 24 17:33:19 2007
@@ -85,7 +85,8 @@
refuse
}
*/
- Process->QuotaUsage[2] += Amount;
+ InterlockedExchangeAdd((LONG*)&Process->QuotaUsage[2], Amount);
+ /* Note: possibility for race. */
if (Process->QuotaPeak[2] < Process->QuotaUsage[2])
{
Process->QuotaPeak[2] = Process->QuotaUsage[2];
@@ -202,7 +203,8 @@
refuse
}
*/
- Process->QuotaUsage[PoolIndex] += Amount;
+ InterlockedExchangeAdd((LONG*)&Process->QuotaUsage[PoolIndex], Amount);
+ /* Note: possibility for race. */
if (Process->QuotaPeak[PoolIndex] < Process->QuotaUsage[PoolIndex])
{
Process->QuotaPeak[PoolIndex] = Process->QuotaUsage[PoolIndex];
@@ -240,7 +242,7 @@
}
else
{
- Process->QuotaUsage[PoolIndex] -= Amount;
+ InterlockedExchangeAdd((LONG*)&Process->QuotaUsage[PoolIndex],
-Amount);
}
}
#else
@@ -301,7 +303,7 @@
}
else
{
- Process->QuotaUsage[2] -= Amount;
+ InterlockedExchangeAdd((LONG*)&Process->QuotaUsage[2], -Amount);
}
}
#else