Skip to content

Commit afa11d4

Browse files
author
kai
committed
Address the stravration duration logic
1 parent 37553e1 commit afa11d4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

IdentityCore/src/requests/broker/MSIDGCDStarvationDetector.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ - (void)monitorLoop {
9494
BOOL starved = [self isThreadStarvedWithTimeout:starvationCheckTimeout];
9595
self.totalPingCount += 1;
9696
if (starved) {
97-
self.gcdStarvedDuration += (starvationCheckTimeout + starvationCheckInterval);
97+
self.gcdStarvedDuration += (starvationCheckTimeout + (self.starvedPingCount == 0 ? 0 : starvationCheckInterval));
9898
self.starvedPingCount += 1;
9999
MSID_LOG_WITH_CTX(MSIDLogLevelVerbose, nil, @"GCDStarvationDetector -- starvation detected, cumulative duration: %.2fms", self.gcdStarvedDuration * 1000);
100100
}

0 commit comments

Comments
 (0)