Created
January 16, 2023 10:16
-
-
Save nkchauhan003/5e2255c9296904c2f57af5e2132763cf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package concurrency.threadsafe; | |
public class AtomicOperations { | |
Object o1 = new Object(); | |
Object o2 = new Object(); | |
public void methodA() { | |
o1 = o2; // an atomic operation | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment