Skip to content

Instantly share code, notes, and snippets.

@nkchauhan003
Created January 16, 2023 10:16
Show Gist options
  • Save nkchauhan003/5e2255c9296904c2f57af5e2132763cf to your computer and use it in GitHub Desktop.
Save nkchauhan003/5e2255c9296904c2f57af5e2132763cf to your computer and use it in GitHub Desktop.
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