summaryrefslogtreecommitdiff
path: root/llvm/include/llvm/Support/Parallel.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include/llvm/Support/Parallel.h')
-rw-r--r--llvm/include/llvm/Support/Parallel.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/include/llvm/Support/Parallel.h b/llvm/include/llvm/Support/Parallel.h
index 28d171d45256..5c3b26d5754c 100644
--- a/llvm/include/llvm/Support/Parallel.h
+++ b/llvm/include/llvm/Support/Parallel.h
@@ -40,7 +40,10 @@ class Latch {
public:
explicit Latch(uint32_t Count = 0) : Count(Count) {}
- ~Latch() { sync(); }
+ ~Latch() {
+ // Ensure at least that sync() was called.
+ assert(Count == 0);
+ }
void inc() {
std::lock_guard<std::mutex> lock(Mutex);