Add Thread Guard for debugging simple threading issues (#4254)

* Add ThreadGuard class

* Use ThreadGuard when accessing a ChannelView's messageSnapshot
This commit is contained in:
pajlada
2022-12-24 11:32:08 +01:00
committed by GitHub
parent 2ba4da02ae
commit b9308d7325
4 changed files with 39 additions and 0 deletions
+1
View File
@@ -628,6 +628,7 @@ const boost::optional<MessageElementFlags> &ChannelView::getOverrideFlags()
LimitedQueueSnapshot<MessageLayoutPtr> &ChannelView::getMessagesSnapshot()
{
this->snapshotGuard_.guard();
if (!this->paused() /*|| this->scrollBar_->isVisible()*/)
{
this->snapshot_ = this->messages_.getSnapshot();