[cfe-dev] libclang cancellation of long running tasks

Jonathan Roelofs jonathan at codesourcery.com
Tue Jan 13 06:16:08 PST 2015



On 1/12/15 7:34 PM, John Sully wrote:
> Hi Jonathan,
>
> I don't understand how std::future::wait_for would allow me to cancel a
> running libclang operation.
>
> I'm not asking how to do this asynchronously - I already have that
> working.  I need a way to stop performing work when the results become
> obsolete. I could always shutdown the thread its on but that would leave
> things in an undefined state.

Sorry, for some reason I thought std::future had a way to kill the task. 
The idea was to loop on the future's wait_for, giving it some small 
interval, then to kill the future if the result is no longer needed.

Jon

--
Jon Roelofs
jonathan at codesourcery.com
CodeSourcery / Mentor Embedded



More information about the cfe-dev mailing list