[cfe-dev] CXCodeCompleteResults and threads

Milian Wolff mail at milianw.de
Tue Jan 21 10:44:38 PST 2014


Hey there,

I know that I can call clang_codeCompleteAt from threads as long as I ensure 
no other thread is doing anything with the TU. But can I use the returned 
results from another thread in a read-only manner without caring about locks? 

Or are the CXCompletionString's mapped into the TU for sharing somehow (cmp. 
CXTranslationUnit_CacheCompletionResults) such that I cannot convert safely 
access the clang_getCompletion* functions?

Put differently, is this safe:

synchronized:
- parse TU
- get completion results

in parallel:
- calling clang_getCompletio* on completion results while the corresponding TU 
potentially is reparsed/deleted/... as long as I didn't call 
clang_disposeCodeCompleteResults?

Thanks, bye
-- 
Milian Wolff
mail at milianw.de
http://milianw.de



More information about the cfe-dev mailing list