Skip to content

Commit f3b9145

Browse files
author
tomscut
committed
using incrementAndGet instead of addAndGet
1 parent 7ce818c commit f3b9145

File tree

1 file changed

+2
-2
lines changed
  • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode

1 file changed

+2
-2
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystemLock.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public void readUnlock(String opName,
192192
final long readLockIntervalMs =
193193
TimeUnit.NANOSECONDS.toMillis(readLockIntervalNanos);
194194
if (needReport && readLockIntervalMs >= this.readLockReportingThresholdMs) {
195-
numReadLockLongHold.addAndGet(1);
195+
numReadLockLongHold.incrementAndGet();
196196
String lockReportInfo = null;
197197
boolean done = false;
198198
while (!done) {
@@ -309,7 +309,7 @@ private void writeUnlock(String opName, boolean suppressWriteLockReport,
309309
LogAction logAction = LogThrottlingHelper.DO_NOT_LOG;
310310
if (needReport &&
311311
writeLockIntervalMs >= this.writeLockReportingThresholdMs) {
312-
numWriteLockLongHold.addAndGet(1);
312+
numWriteLockLongHold.incrementAndGet();
313313
if (longestWriteLockHeldInfo.getIntervalMs() <= writeLockIntervalMs) {
314314
String lockReportInfo = lockReportInfoSupplier != null ? " (" +
315315
lockReportInfoSupplier.get() + ")" : "";

0 commit comments

Comments
 (0)