shared methods

unknown soldier unknownsoldier at gmail.com
Wed Jan 22 15:25:23 PST 2014


> The compiler does not do this for you, because it can not know 
> if accessing any member is truly thread-safe. You might share 
> the logFile with other instances of Foo. This would be a case 
> where the compiler would wrongly remove the shared from this, 
> if it would do so automatically inside synchronized blocks.

Makes sense; thank you!


More information about the Digitalmars-d-learn mailing list