Files
chatterino2/lib/appbase/debug/AssertInGuiThread.hpp
2019-07-23 23:55:31 +02:00

17 lines
290 B
C++

#pragma once
#include <QCoreApplication>
#include <QThread>
#include <cassert>
namespace AB_NAMESPACE {
static void assertInGuiThread()
{
#ifdef _DEBUG
assert(QCoreApplication::instance()->thread() == QThread::currentThread());
#endif
}
} // namespace AB_NAMESPACE