Sonde v1.1.0
Embeddable Model Context Protocol server for Qt applications
Loading...
Searching...
No Matches
threadcheck_p.h File Reference

Private: the loud checks that Sonde's thread-affine functions are called on the right thread (design 0031, R9). More...

#include <sonde/sonde_core_export.h>
#include <QtCore/qglobal.h>

Go to the source code of this file.

Namespaces

namespace  Sonde
 Embeddable Model Context Protocol server for Qt applications.

Macros

#define SONDE_CHECK_THREAD(owner)
 Checks that this is owner's thread (see Sonde::Detail::checkObjectThread()).
#define SONDE_CHECK_GUI_THREAD()
 Checks that this is the GUI thread (see Sonde::Detail::checkGuiThread()).

Functions

bool Sonde::Detail::checkGuiThread (const char *function)
 Whether this is the GUI thread (the application object's).
bool Sonde::Detail::checkObjectThread (const QObject *owner, const char *function)
 Whether this is owner's thread.

Detailed Description

Private: the loud checks that Sonde's thread-affine functions are called on the right thread (design 0031, R9).

Macro Definition Documentation

◆ SONDE_CHECK_GUI_THREAD

#define SONDE_CHECK_GUI_THREAD ( )
Value:
bool checkGuiThread(const char *function)
Whether this is the GUI thread (the application object's).
Definition threadcheck.cpp:11

Checks that this is the GUI thread (see Sonde::Detail::checkGuiThread()).

◆ SONDE_CHECK_THREAD

#define SONDE_CHECK_THREAD ( owner)
Value:
bool checkObjectThread(const QObject *owner, const char *function)
Whether this is owner's thread.
Definition threadcheck.cpp:24

Checks that this is owner's thread (see Sonde::Detail::checkObjectThread()).

Function Documentation

◆ checkGuiThread()

bool Sonde::Detail::checkGuiThread ( const char * function)

Whether this is the GUI thread (the application object's).

If it isn't, says so with qCritical(), naming function, and asserts: the caller races with the GUI. True if there is no application object yet.

◆ checkObjectThread()

bool Sonde::Detail::checkObjectThread ( const QObject * owner,
const char * function )

Whether this is owner's thread.

If it isn't, says so with qCritical(), naming function, and asserts.