add doc write lock and make imgui use it

This commit is contained in:
Green Sky
2025-09-02 11:36:05 +02:00
parent 396a03c229
commit 9cab041af4
4 changed files with 80 additions and 8 deletions

View File

@@ -4,6 +4,7 @@
#include <solanaceae/contact/fwd.hpp>
#include <set>
#include <unordered_set>
class CRDTNotesImGui {
CRDTNotes& _notes;
@@ -13,6 +14,9 @@ class CRDTNotesImGui {
bool _show_global_list {true};
std::set<CRDTNotes::DocID> _open_docs;
std::unordered_set<CRDTNotes::DocWriteLock> _held_locks;
std::unordered_set<CRDTNotes::DocWriteLock>::iterator findLock(const CRDTNotes::DocID& doc_id);
public:
CRDTNotesImGui(CRDTNotes& notes, CRDTNotesSync& notes_sync, ContactStore4I& cs);
@@ -22,6 +26,5 @@ class CRDTNotesImGui {
bool renderContactListContactSmall(const Contact4 c, const bool selected) const;
bool renderDoc(const CRDTNotes::DocID& doc_id);
bool renderDocText(std::string& text) const;
};