Should core.sync.mutex.Mutex, core.sync.condition.Condition, etc. have all their methods be shared?

Sean Kelly sean at invisibleduck.org
Sun Nov 18 14:48:02 PST 2012


On Nov 18, 2012, at 12:44 PM, Jonathan M Davis <jmdavisProg at gmx.com> wrote:
> 
> So, I concur in that I don't see how the semantics of shared could possibly 
> not be appropriate for mutexes. I started this thread primarily because I was 
> shocked that Mutex, Condition, etc. weren't marked with shared already, and I 
> didn't see how they could even be used without it (and apparently, the answer 
> to that is that almost everyone cops out and uses __gshared).

I tried this once and it cascaded to requiring modifications of various definitions on core.sys.posix to add a "shared" qualifier, and since I wasn't ready to do that I rolled back the changes.  I guess the alternative would be to have a shared equivalent for every operation that basically just casts away shared and then calls the non-shared function, but that's such a terrible design I've been resisting it.


More information about the Digitalmars-d mailing list