Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/FilterEngine.cpp

Issue 29449592: Issue 5183 - Provide async interface for FileSystem (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Rebase on master. Last changes. Created July 7, 2017, 1:36 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/FileSystemJsObject.cpp ('k') | src/JsEngine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/FilterEngine.cpp
===================================================================
--- a/src/FilterEngine.cpp
+++ b/src/FilterEngine.cpp
@@ -175,47 +175,16 @@
return jsEngine->Evaluate("API.isAASubscription").Call(*this).AsBool();
}
bool Subscription::operator==(const Subscription& subscription) const
{
return GetProperty("url").AsString() == subscription.GetProperty("url").AsString();
}
-namespace
-{
- class Sync
- {
- public:
- Sync()
- :initialized(false)
- {
-
- }
- void Wait()
- {
- std::unique_lock<std::mutex> lock(mutex);
- while (!initialized)
- cv.wait(lock);
- }
- void Set()
- {
- {
- std::unique_lock<std::mutex> lock(mutex);
- initialized = true;
- }
- cv.notify_all();
- }
- private:
- std::mutex mutex;
- std::condition_variable cv;
- bool initialized;
- };
-}
-
FilterEngine::FilterEngine(const JsEnginePtr& jsEngine)
: jsEngine(jsEngine), firstRun(false), updateCheckId(0)
{
}
void FilterEngine::CreateAsync(const JsEnginePtr& jsEngine,
const FilterEngine::OnCreatedCallback& onCreated,
const FilterEngine::CreationParameters& params)
« no previous file with comments | « src/FileSystemJsObject.cpp ('k') | src/JsEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld