[cfe-dev] [LLVMdev] ASTUnit Concurrent Access

Manuel Klimek klimek at google.com
Mon Jun 2 01:39:37 PDT 2014


On Fri, May 30, 2014 at 10:35 PM, Reid Kleckner <rnk at google.com> wrote:

> llvm-dev -> cfe-dev, since ASTUnit.h is a Clang thing.
>
> Maybe Manuel knows what it is, since it's used by Tooling?
>

I'm not aware that ASTUnit is used by libTooling. As far as I know, clang
is not intended to be thread-safe, and thus probably isn't.


> On Fri, May 30, 2014 at 12:56 PM, Zachary Turner <zturner at google.com>
> wrote:
>
>> In ASTUnit.h, there is a ConcurrencyState class which has the following
>> comment;
>>
>>   /// \brief Allows us to assert that ASTUnit is not being used
>> concurrently,
>>   /// which is not supported.
>>   ///
>>   /// Clients should create instances of the ConcurrencyCheck class
>> whenever
>>   /// using the ASTUnit in a way that isn't intended to be concurrent,
>> which is
>>   /// just about any usage.
>>   /// Becomes a noop in release mode; only useful for debug mode checking.
>>
>> In ASTUnit.cpp, there is a function called cleanupOnDiskMapAtExit(),
>> which has the following comment:
>>
>>   // Use the mutex because there can be an alive thread destroying an
>> ASTUnit.
>>
>> Can someone clarify the intended behavior here?  These two comments seem
>> to contradict each other.
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140602/42c069cc/attachment.html>


More information about the cfe-dev mailing list