Static constructor

SealabJaster sealabjaster at gmail.com
Thu Jan 7 01:59:24 UTC 2021


On Thursday, 7 January 2021 at 01:55:07 UTC, SealabJaster wrote:
> ...

And on a side note, I don't believe this code is working as the 
author intends.

Someone correct me if I'm wrong, but `static` variables in D 
arethread-local, so a `static Object mutex` wouldn't actually be 
visible between threads unless passed via some other means, and 
would instead act as a mutex-per-thread, sort of defying the 
point?

However `__gshared Object mutex` would likely be what they want?

I don't do much multithreaded stuff in D, so that information may 
or may not be correct.


More information about the Digitalmars-d-learn mailing list