The "no gc" crowd
Dicebot
public at dicebot.lv
Thu Oct 10 05:04:41 PDT 2013
On Thursday, 10 October 2013 at 04:24:31 UTC, Jonathan M Davis
wrote:
>> Also, casting _away_ shared is going to be a very common
>> operation due to
>> how shared works.
It is yet another use case for `scope` storage class. Locking
`shared` variable via mutex should return same variable but
casted to non-shared `scope` (somewhere inside the locking
library function). Then it is safe to pass it to functions
accepting scope parameters as reference won't possibly escape.
More information about the Digitalmars-d
mailing list