A monitor for every object

Sean Kelly sean at invisibleduck.org
Fri Feb 4 15:29:08 PST 2011


On Feb 4, 2011, at 3:06 PM, Tomek Sowiński wrote:

> Steven Schveighoffer napisał:
> 
>> D also allows you to replace it's monitor with a custom monitor object  
>> (i.e. core.sync.Mutex) so you can have more control over the mutex, assign  
>> the same mutex to multiple objects, use conditions, etc.  It's much more  
>> flexible than Java or C# IMO.
> 
> I didn't know, thx. Where is it documented?

Only in the docs for the Mutex ctor here:

http://www.digitalmars.com/d/2.0/phobos/core_sync_mutex.html

By the way, when using Mutex as an object monitor you currently can't attach dispose event handlers to the object (ie. via std.signals).  That functionality is only supported by the default monitor.  I've considered changing this, but doing so imposes some weird requirements on the creators of an external object monitor, like Mutex.


More information about the Digitalmars-d mailing list