synchronized/shared associative array .require error

Steven Schveighoffer schveiguy at gmail.com
Sat Sep 3 14:37:16 UTC 2022


On 9/2/22 3:15 PM, cc wrote:

> Tried casting away shared as a workaround but I assume that will cause 
> some kind of TLS catastrophe.
> 

I think it will be fine, but you may have an issue. You are returning a 
non-shared `VAL`, but your class is `shared`, which means `table`, and 
all the `VAL` and `KEY` inside must also be `shared`.

If you cast away `shared` you have to put it back upon return.

TLS should not be involved here at all, so there is no problem there.

-Steve


More information about the Digitalmars-d-learn mailing list