added mutex to items

This commit is contained in:
itsmattkc
2019-07-07 23:35:34 -05:00
parent 06f195eca1
commit 7b870de338
3 changed files with 20 additions and 0 deletions
+10
View File
@@ -120,3 +120,13 @@ bool Item::CanHaveChildren() const
{
return false;
}
void Item::Lock()
{
mutex_.lock();
}
void Item::Unlock()
{
mutex_.unlock();
}
+6
View File
@@ -24,6 +24,7 @@
#include <memory>
#include <QIcon>
#include <QList>
#include <QMutex>
#include <QString>
class Item;
@@ -96,6 +97,9 @@ public:
virtual bool CanHaveChildren() const;
void Lock();
void Unlock();
private:
QList<ItemPtr> children_;
@@ -107,6 +111,8 @@ private:
QString tooltip_;
QMutex mutex_;
};
#endif // ITEM_H
+4
View File
@@ -34,7 +34,11 @@ ProbeTask::ProbeTask(FootagePtr footage) :
bool ProbeTask::Action()
{
footage_->Lock();
olive::ProbeMedia(footage_.get());
footage_->Unlock();
return true;
}