MCPcopy Create free account
hub / github.com/Snapchat/Valdi / fullTeardown

Method fullTeardown

valdi_core/src/valdi_core/cpp/Threading/GCDDispatchQueue.cpp:245–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243}
244
245void GCDDispatchQueue::fullTeardown() {
246 teardown();
247
248 // Try to acquire the execution lock with timeout to ensure no tasks are executing
249 // If we can acquire it, all tasks have completed. If timeout, proceed anyway to
250 // avoid indefinite hang (preserves COMPOSER-837 JSCore deadlock workaround).
251 if (!_executionMutex.try_lock_for(std::chrono::seconds(2))) {
252 // Timeout - log and proceed anyway
253 // This should be rare and indicates tasks are taking too long to complete
254 } else {
255 // Successfully acquired lock - all tasks complete, release it
256 _executionMutex.unlock();
257 }
258}
259
260bool GCDDispatchQueue::wasDestroyed() const {
261 return _destroyed.load();

Callers 1

flushAndTeardownMethod · 0.45

Calls 1

unlockMethod · 0.45

Tested by

no test coverage detected