mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-12 15:24:18 +00:00
Fix the generic implementation of ExternalCommitHelper
This commit is contained in:
parent
4eb49ce6dc
commit
e557babaad
@ -32,7 +32,10 @@ ExternalCommitHelper::ExternalCommitHelper(RealmCoordinator& parent)
|
||||
, m_sg(*m_history, parent.is_in_memory() ? SharedGroup::durability_MemOnly : SharedGroup::durability_Full,
|
||||
parent.get_encryption_key().data())
|
||||
, m_thread(std::async(std::launch::async, [=] {
|
||||
m_sg.begin_read();
|
||||
while (m_sg.wait_for_change()) {
|
||||
m_sg.end_read();
|
||||
m_sg.begin_read();
|
||||
m_parent.on_change();
|
||||
}
|
||||
}))
|
||||
|
@ -40,12 +40,12 @@ public:
|
||||
private:
|
||||
RealmCoordinator& m_parent;
|
||||
|
||||
// The listener thread
|
||||
std::future<void> m_thread;
|
||||
|
||||
// A shared group used to listen for changes
|
||||
std::unique_ptr<ClientHistory> m_history;
|
||||
SharedGroup m_sg;
|
||||
|
||||
// The listener thread
|
||||
std::future<void> m_thread;
|
||||
};
|
||||
|
||||
} // namespace _impl
|
||||
|
Loading…
x
Reference in New Issue
Block a user