mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
22 lines
328 B
C++
22 lines
328 B
C++
#pragma once
|
|
|
|
#include <QCoreApplication>
|
|
#include <QThread>
|
|
|
|
#include <cassert>
|
|
|
|
namespace chatterino {
|
|
|
|
inline bool isGuiThread()
|
|
{
|
|
return QCoreApplication::instance()->thread() == QThread::currentThread();
|
|
}
|
|
|
|
inline void assertInGuiThread()
|
|
{
|
|
#ifdef _DEBUG
|
|
assert(isGuiThread());
|
|
#endif
|
|
}
|
|
|
|
} // namespace chatterino
|