Skip to content
Permalink
Browse files
8254146: Avoid unnecessary volatile write on new AtomicBoolean(false)
Reviewed-by: redestad, rriggs, chegar
  • Loading branch information
dreis2211 authored and Roger Riggs committed Oct 8, 2020
1 parent 6d13c76 commit 7e82ba1ff04148f7c843cb321f581a41fe22d5b6
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/java.base/share/classes/java/util/concurrent/atomic/AtomicBoolean.java
@@ -68,7 +68,9 @@
* @param initialValue the initial value
*/
public AtomicBoolean(boolean initialValue) {
value = initialValue ? 1 : 0;
if (initialValue) {
value = 1;
}
}

/**

1 comment on commit 7e82ba1

@bridgekeeper

This comment has been minimized.

Copy link

@bridgekeeper bridgekeeper bot commented on 7e82ba1 Oct 8, 2020

Please sign in to comment.