Deprecation: Read-modify-write operations are not allowed for shared variables

Timothee Cour via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Aug 12 03:01:22 PDT 2014


dmd 2.066(rc) generates warning: 'Deprecation: Read-modify-write operations
are not allowed for shared variables. Use core.atomic.atomicOp!"-="(a, 1)
instead.' for following code:

synchronized {
  ++a;
}

Is that correct given that it's inside synchronized?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20140812/44d72a9c/attachment.html>


More information about the Digitalmars-d-learn mailing list