On Feb 27, 2014, at 6:38 AM, Rafael Espíndola <[email protected]> 
wrote:

>> And even worse, because RealFileSystem is an implementation detail, and
>> getRealFileSystem returns a ref counted pointer by value, I cannot see any
>> way to get me a RealFileSystem without locking.
> 
> Maybe we could use a plain point in here. As Douglas says, that would
> "toss the responsibility for managing the FS instance up to “the
> client”", but the only client that needs reference counting should be
> libclang and it can do it with a non-intrusive counter wrapping the
> pointer (like a shared_ptr).

I prefer the solution that Argyrios proposed, to use a thread-safe ref count.  
It has the nice property that we keep management of these pointers homogeneous 
between internal and external clients.

Ben

> 
> Cheers,
> Rafael


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to