moved files into src/common

This commit is contained in:
fourtf
2018-06-26 15:33:51 +02:00
parent 0bc08a364c
commit 15abedd869
90 changed files with 150 additions and 150 deletions
+38
View File
@@ -0,0 +1,38 @@
#pragma once
#include <mutex>
namespace chatterino {
template <typename Type>
class LockedObject
{
public:
LockedObject &operator=(const LockedObject<Type> &other)
{
this->mutex.lock();
this->data = other.getValue();
this->mutex.unlock();
return *this;
}
LockedObject &operator=(const Type &other)
{
this->mutex.lock();
this->data = other;
this->mutex.unlock();
return *this;
}
private:
Type value;
std::mutex mutex;
};
} // namespace chatterino