Acess variable that was set by thread

Steven Schveighoffer schveiguy at gmail.com
Mon Aug 8 13:31:04 UTC 2022


On 8/8/22 6:17 AM, ag0aep6g wrote:
> On Monday, 8 August 2022 at 07:14:33 UTC, vc wrote:
>> it seems change it to working is working
>>
>> ```d
>>  __gshared bool zeus;
>>  ```
>>
>> but as I'm new in to D, i will like to hear thoughts even if it works 
>> for me
> 
> Never ever use `__gshared` ever. It's a glaring safety hole. Use 
> `shared` instead.

If you are interfacing with C, you need __gshared. But yeah, you should 
use shared in this case.

-Steve


More information about the Digitalmars-d-learn mailing list