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

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Aug 12 08:06:27 PDT 2014


On Tue, 12 Aug 2014 03:01:22 -0700
Timothee Cour via Digitalmars-d-learn
<digitalmars-d-learn at puremagic.com> wrote:

> Is that correct given that it's inside synchronized?
yes. synchronized doesn't lock *any* access to a (consider two
different shared classes, for example), it just prevents simultaneous
access in this given part of code. so to be on the safe side, use
atomic operations.

besides, using atomic operations will allow you to drop synchronize
altogether which makes your code slightly faster.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20140812/54363445/attachment.sig>


More information about the Digitalmars-d-learn mailing list