mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8254146: Avoid unnecessary volatile write on new AtomicBoolean(false)
Reviewed-by: redestad, rriggs, chegar
This commit is contained in:
parent
6d13c766bf
commit
7e82ba1ff0
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue