mirror of
https://github.com/reactos/reactos.git
synced 2025-04-27 17:10:22 +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
|
||||
}
|
||||
*/
|
||||
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 @@ PsChargeProcessPoolQuota(IN PEPROCESS Process,
|
|||
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 @@ PsReturnPoolQuota(IN PEPROCESS Process,
|
|||
}
|
||||
else
|
||||
{
|
||||
Process->QuotaUsage[PoolIndex] -= Amount;
|
||||
InterlockedExchangeAdd((LONG*)&Process->QuotaUsage[PoolIndex], -Amount);
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
@ -301,7 +303,7 @@ PsReturnProcessPageFileQuota(IN PEPROCESS Process,
|
|||
}
|
||||
else
|
||||
{
|
||||
Process->QuotaUsage[2] -= Amount;
|
||||
InterlockedExchangeAdd((LONG*)&Process->QuotaUsage[2], -Amount);
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
|
Loading…
Reference in a new issue