sammccall added a comment. I wanted to send a first version out for feedback even if incomplete. (I want to do more extensive tests, and likely we should think about having an in-tree throttler on by default)
To motivate the design: - when attempting to acquire a slot, we want to wait on (acquired || shutting down). - This means sharing a condition variable for both events, as we can't wait on multiple conditions. - this leads to the callback-based model for PreambleThrottler, the callback lets us encapsulate the use of a shared CV in this way - the acquire callback naturally accesses the PreambleThread, but it might have gone away concurrently. This is awkward to solve in a callback API. - The chosen solution is to heap-allocate a small object that can own the state the callback needs to access Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129100/new/ https://reviews.llvm.org/D129100 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits