[PATCH] D50502: [clangd] Initial cancellation mechanism for LSP requests.

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 14 14:30:38 PDT 2018


kadircet added inline comments.


================
Comment at: clangd/Cancellation.h:71
+
+class TaskHandle {
+public:
----------------
ilya-biryukov wrote:
> I wonder if we should make `TaskHandle` move-only?
> 
> The reasoning is that is can be easily used from multiple threads (since it's used by code dealing with async tasks anyway) and copying it concurrently is a data race.
> On the other hand, calling `cancel()` is perfectly thread-safe and shouldn't cause any problems.
As similar to above mentioned case copying doesn't introduce any data races.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D50502





More information about the cfe-commits mailing list