On Wednesday, 8 July 2015 at 12:21:22 UTC, Jonathan M Davis wrote:
On Wednesday, 8 July 2015 at 11:02:19 UTC, Márcio Martins wrote:
[...]
Interesting, so the main pain of using shared is the requirement
to cast away the shared whenever you want to work on the data in
a synchronized block.
Is there any links do you know to the old conversations on what
solutions are there for this?
My first thought is using the 'with' keyword.
shared int mySharedInt;
synchronised(mutexObj) with (mySharedInt){
// any references to mySharedInt in this block are implicitly
converted to non-shared
}