8254146: Avoid unnecessary volatile write on new AtomicBoolean(false)

Reviewed-by: redestad, rriggs, chegar
This commit is contained in:
Christoph Dreis 2020-10-08 13:18:09 +00:00 committed by Roger Riggs
parent 6d13c766bf
commit 7e82ba1ff0

View File

@ -68,7 +68,9 @@ public class AtomicBoolean implements java.io.Serializable {
* @param initialValue the initial value
*/
public AtomicBoolean(boolean initialValue) {
value = initialValue ? 1 : 0;
if (initialValue) {
value = 1;
}
}
/**