mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 17:52:56 +00:00
Interlocked add/sub for quota. Still disabled code.
svn path=/trunk/; revision=29853
This commit is contained in:
parent
5005dede1c
commit
443c699ba3
1 changed files with 6 additions and 4 deletions
|
@ -85,7 +85,8 @@ PsChargeProcessPageFileQuota(IN PEPROCESS Process,
|
||||||
refuse
|
refuse
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
Process->QuotaUsage[2] += Amount;
|
InterlockedExchangeAdd((LONG*)&Process->QuotaUsage[2], Amount);
|
||||||
|
/* Note: possibility for race. */
|
||||||
if (Process->QuotaPeak[2] < Process->QuotaUsage[2])
|
if (Process->QuotaPeak[2] < Process->QuotaUsage[2])
|
||||||
{
|
{
|
||||||
Process->QuotaPeak[2] = Process->QuotaUsage[2];
|
Process->QuotaPeak[2] = Process->QuotaUsage[2];
|
||||||
|
@ -202,7 +203,8 @@ PsChargeProcessPoolQuota(IN PEPROCESS Process,
|
||||||
refuse
|
refuse
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
Process->QuotaUsage[PoolIndex] += Amount;
|
InterlockedExchangeAdd((LONG*)&Process->QuotaUsage[PoolIndex], Amount);
|
||||||
|
/* Note: possibility for race. */
|
||||||
if (Process->QuotaPeak[PoolIndex] < Process->QuotaUsage[PoolIndex])
|
if (Process->QuotaPeak[PoolIndex] < Process->QuotaUsage[PoolIndex])
|
||||||
{
|
{
|
||||||
Process->QuotaPeak[PoolIndex] = Process->QuotaUsage[PoolIndex];
|
Process->QuotaPeak[PoolIndex] = Process->QuotaUsage[PoolIndex];
|
||||||
|
@ -240,7 +242,7 @@ PsReturnPoolQuota(IN PEPROCESS Process,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Process->QuotaUsage[PoolIndex] -= Amount;
|
InterlockedExchangeAdd((LONG*)&Process->QuotaUsage[PoolIndex], -Amount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -301,7 +303,7 @@ PsReturnProcessPageFileQuota(IN PEPROCESS Process,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Process->QuotaUsage[2] -= Amount;
|
InterlockedExchangeAdd((LONG*)&Process->QuotaUsage[2], -Amount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue