[D-runtime] Can we remove setSameMutex()?

Sean Kelly sean at invisibleduck.org
Wed Sep 5 11:25:37 PDT 2012


(copying the list)

On Sep 5, 2012, at 11:24 AM, Sean Kelly <sean at invisibleduck.org> wrote:

> It's there because the function is in TDPL.  The idea was to use it for things like containers where the mutex protecting the container should also be used to protect every node within the container.  This is kind of half-implemented right now because the default monitor is not tracked by the GC, so reference counting would need to be added if it were to be usable within dtors.  The alternate would be to use the GC-tracked Mutex object which can't be used in dtors anyway.  Either way, I think the function should remain since it's a TDPL thing.  We just need to figure out how to make it more useful.
> 
> On Sep 5, 2012, at 7:16 AM, Alex Rønne Petersen <xtzgzorex at gmail.com> wrote:
> 
>> Sean, this function appears to have been added by you originally. Ping?
>> 
>> Regards,
>> Alex
>> 
>> On Sun, Sep 2, 2012 at 11:35 AM, Alex Rønne Petersen
>> <xtzgzorex at gmail.com> wrote:
>>> Hi,
>>> 
>>> I think this function is a bit too unsafe to be part of the public
>>> API. Things can break horrifically if it's used after
>>> rt_attachDisposeEvent, for instance. Besides, it doesn't appear to be
>>> used anywhere in druntime or phobos.
>>> 
>>> Would anyone be opposed to removing it?
>>> 
>>> Regards,
>>> Alex
> 



More information about the D-runtime mailing list