Skip to content

Commit

Permalink
Got rid of the Thread.yield TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Pechkurov committed Nov 19, 2018
1 parent 1b67825 commit c53b27b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/ru/puzpuzpuz/http/util/OptimisticLock.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public final class OptimisticLock {
public void lock() {
while (!tryLock()) {
// keep the loop
// TODO consider using Thread.yield() here to avoid core starvation
Thread.yield(); // avoiding CPU core starvation
}
}

Expand Down

0 comments on commit c53b27b

Please sign in to comment.