zim dictionary:remove semphore

This commit is contained in:
yifang 2021-12-28 20:29:27 +08:00
parent 4157fb387e
commit 8e6f4c2c10

18
zim.cc
View file

@ -1188,7 +1188,7 @@ public:
~ZimArticleRequest() ~ZimArticleRequest()
{ {
isCancelled.ref(); isCancelled.ref();
hasExited.acquire(); //hasExited.acquire();
} }
}; };
@ -1353,7 +1353,7 @@ public:
~ZimResourceRequestRunnable() ~ZimResourceRequestRunnable()
{ {
hasExited.release(); //hasExited.release();
} }
virtual void run(); virtual void run();
@ -1371,15 +1371,9 @@ class ZimResourceRequest: public Dictionary::DataRequest
QSemaphore hasExited; QSemaphore hasExited;
public: public:
ZimResourceRequest(ZimDictionary &dict_, string const &resourceName_)
ZimResourceRequest( ZimDictionary & dict_, : dict(dict_), resourceName(resourceName_) {
string const & resourceName_ ): (new ZimResourceRequestRunnable(*this, hasExited))->run();
dict( dict_ ),
resourceName( resourceName_ )
{
(new ZimResourceRequestRunnable(*this, hasExited))->run();
// QThreadPool::globalInstance()->start(
// new ZimResourceRequestRunnable( *this, hasExited ) );
} }
void run(); // Run from another thread by ZimResourceRequestRunnable void run(); // Run from another thread by ZimResourceRequestRunnable
@ -1392,7 +1386,7 @@ public:
~ZimResourceRequest() ~ZimResourceRequest()
{ {
isCancelled.ref(); isCancelled.ref();
hasExited.acquire(); //hasExited.acquire();
} }
}; };