worked on thread safety with tasks

This commit is contained in:
itsmattkc
2019-08-09 12:31:02 +10:00
parent c0f6ee534a
commit 1616166fbc
9 changed files with 137 additions and 27 deletions
-10
View File
@@ -157,13 +157,3 @@ bool Item::ChildExistsWithNameInternal(const QString &name, Item *folder)
return false;
}
void Item::Lock()
{
mutex_.lock();
}
void Item::Unlock()
{
mutex_.unlock();
}
+3 -6
View File
@@ -27,6 +27,8 @@
#include <QMutex>
#include <QString>
#include "common/threadedobject.h"
class Item;
using ItemPtr = std::shared_ptr<Item>;
@@ -36,7 +38,7 @@ using ItemPtr = std::shared_ptr<Item>;
* Project objects implement a parent-child hierarchy of Items that can be used throughout the Project. The Item class
* itself is abstract and will need to be subclassed to be used in a Project.
*/
class Item
class Item : public ThreadedObject
{
public:
enum Type {
@@ -100,9 +102,6 @@ public:
bool ChildExistsWithName(const QString& name);
void Lock();
void Unlock();
private:
bool ChildExistsWithNameInternal(const QString& name, Item* folder);
@@ -116,8 +115,6 @@ private:
QString tooltip_;
QMutex mutex_;
};
#endif // ITEM_H