MCPcopy Create free account
hub / github.com/IENT/YUView / ~VideoCache

Method ~VideoCache

YUViewLib/src/video/VideoCache.cpp:271–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

269}
270
271VideoCache::~VideoCache()
272{
273 DEBUG_CACHING("VideoCache::~VideoCache Terminate all workers and threads");
274
275 // Tell all threads to quit
276 for (loadingThread *t : cachingThreadList)
277 t->quitWhenDone();
278 interactiveThread[0]->quitWhenDone();
279 interactiveThread[1]->quitWhenDone();
280
281 // Wait for the threads to quit, otherwise terminate them
282 for (int i = 0; i < 2; i++)
283 if (!interactiveThread[i]->wait(3000))
284 {
285 interactiveThread[i]->terminate();
286 interactiveThread[i]->wait();
287 }
288 for (loadingThread *t : cachingThreadList)
289 if (!t->wait(3000))
290 {
291 t->terminate();
292 t->wait();
293 }
294
295 // Delete all threads
296 for (loadingThread *t : cachingThreadList)
297 t->deleteLater();
298}
299
300void VideoCache::startWorkerThreads(int nrThreads)
301{

Callers

nothing calls this directly

Calls 1

quitWhenDoneMethod · 0.80

Tested by

no test coverage detected