QSqlQuery::exec()
blocks (synchronously) but not atomically, the OS can interrupt the thread and start another thread in between.
Note that you shouldn't share the same database connection across streams anyway, so it shouldn't be a problem.
source
to share