Using ReadWriteMutex with synchronized{} ?

E.S. Quinn anonymous at example.com
Sun Oct 6 14:25:59 PDT 2013


I need to share an associative array between two threads, and to 
that extent I'd like to make the whole thing synchronized. And 
I'd like to use the built-in synchronized{} blocks, and I'd also 
like to use the ReadWriteMutex from core.sync.rwmutex, since it 
seems pretty much tailor-made for this sort of thing.

Is it possible to, for example, tell D that I want the enclosing 
class synchronized with a ReadWriteMutex, and then specifcy which 
functions need a reader lock and which need writer locks? Or will 
I have to lock and unlock the mutex manually?


More information about the Digitalmars-d-learn mailing list