mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
22 lines
352 B
C++
22 lines
352 B
C++
#pragma once
|
|
|
|
#include <QCoreApplication>
|
|
#include <QThread>
|
|
#include <cassert>
|
|
|
|
namespace AB_NAMESPACE {
|
|
|
|
static bool isGuiThread()
|
|
{
|
|
return QCoreApplication::instance()->thread() == QThread::currentThread();
|
|
}
|
|
|
|
static void assertInGuiThread()
|
|
{
|
|
#ifdef _DEBUG
|
|
assert(isGuiThread());
|
|
#endif
|
|
}
|
|
|
|
} // namespace AB_NAMESPACE
|