refs #522, mutex for mutable members (thread safe)

* copy/assignment/lock for mutable members
* also removed redundant in status message (slack discussion MS/KB)
This commit is contained in:
Klaus Basan
2015-11-26 02:31:13 +01:00
parent a4ba45ce75
commit d6733d49bb
13 changed files with 115 additions and 73 deletions

View File

@@ -25,7 +25,7 @@ namespace BlackMisc
{
public:
//! Default constructor.
CPixmap();
CPixmap() = default;
//! Constructor.
CPixmap(const QPixmap &pixmap);
@@ -57,11 +57,10 @@ namespace BlackMisc
//! Init the byte array with data
void fillByteArray();
QByteArray m_array; //!< data of pixmap
mutable QPixmap m_pixmap; //!< cached pixmap, mutable because of lazy initialization
mutable bool m_hasCachedPixmap = false; //!< pixmap? Mutable because of lazy initialization
mutable QReadWriteLock m_lock; //!< lock (because of mutable members)
QByteArray m_array; //!< data of pixmap
};
} // namespace