Skip to content

Instantly share code, notes, and snippets.

@levinotik
Created October 30, 2014 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save levinotik/9e07399af4f9820e39c1 to your computer and use it in GitHub Desktop.
Save levinotik/9e07399af4f9820e39c1 to your computer and use it in GitHub Desktop.
import scala.concurrent.ExecutionContext.Implicits.global
var i = 1
scala.concurrent.Future{i = 2} //something "happens"
@viktorklang
Copy link

That is JMM-wise broken, there is no happens-before relationship between the var and the thunk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment