Correct our implementation of Thread.VolatileRead ()/VolatileWrite ().
authorAlex Rønne Petersen <alexrp@xamarin.com>
Fri, 6 Sep 2013 02:16:21 +0000 (04:16 +0200)
committerAlex Rønne Petersen <alexrp@xamarin.com>
Mon, 21 Oct 2013 15:59:30 +0000 (17:59 +0200)
commit53398c4641b2dc2f55d577778b13cca8ef223b40
treec724c9c6249f923e7eee2541cd492fd0d1c70143
parent421e1beea55d26d767dbd857e2f2276e3c6c2bee
Correct our implementation of Thread.VolatileRead ()/VolatileWrite ().

We have various issues:

* All of the functions assumed that doing volatile loads/stores was
  enough, when load-acquire, store-release semantics were actually
  needed. This may have worked before purely by chance. We now use
  proper memory barriers so that we don't have to hope for the
  compiler and CPU to do the right thing.
* Removes the hack for 64-bit quantities on 32-bit systems. This is
  no longer needed now that we use explicit memory barriers in
  these functions. Also, these functions are not supposed to do
  atomic reads/writes in the first place - they're purely about the
  memory barrier semantics.
* The VolatileWrite (object&, object) overload was not using the
  volatile qualifier at all, thus not getting volatile semantics
  as per: http://gcc.gnu.org/onlinedocs/gcc/Volatiles.html
mono/metadata/threads.c