added mutex to items
This commit is contained in:
@@ -120,3 +120,13 @@ bool Item::CanHaveChildren() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void Item::Lock()
|
||||
{
|
||||
mutex_.lock();
|
||||
}
|
||||
|
||||
void Item::Unlock()
|
||||
{
|
||||
mutex_.unlock();
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -34,7 +34,11 @@ ProbeTask::ProbeTask(FootagePtr footage) :
|
||||
|
||||
bool ProbeTask::Action()
|
||||
{
|
||||
footage_->Lock();
|
||||
|
||||
olive::ProbeMedia(footage_.get());
|
||||
|
||||
footage_->Unlock();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user