本文整理汇总了C++中Global::stackDump方法的典型用法代码示例。如果您正苦于以下问题:C++ Global::stackDump方法的具体用法?C++ Global::stackDump怎么用?C++ Global::stackDump使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Global
的用法示例。
在下文中一共展示了Global::stackDump方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: exec
// Generic exec(). A prepare should have been done already
bool NSqlQuery::exec() {
bool indexPauseSave;
bool indexRestoreNeeded = false;
QLOG_DEBUG() << "Sending SQL:" << getLastExecutedQuery(*this);
for (int i=1; i<1000; i++) {
bool rc = QSqlQuery::exec();
if (rc) {
if (indexRestoreNeeded)
global.indexRunner->pauseIndexing = indexPauseSave;
return true;
}
if (lastError().number() != DATABASE_LOCKED)
return false;
if (i>DEBUG_TRIGGER) {
QLOG_ERROR() << "DB Locked: Retry #" << i;
}
if (i == INDEX_PAUSE_TRIGGER && this->db->getConnectionName() != "indexrunner") {
QLOG_DEBUG() << "Pausing indexrunner due to db lock";
indexPauseSave = global.indexRunner->pauseIndexing;
indexRestoreNeeded = true;
global.indexRunner->pauseIndexing=true;
}
// Print stack trace to see what is happening
if (i==DEBUG_TRIGGER) {
QLOG_DEBUG() << "Dumping stack due to DB lock limit of " << DEBUG_TRIGGER << " being reached.";
global.stackDump();
}
QTime dieTime= QTime::currentTime().addSecs(1);
while( QTime::currentTime() < dieTime )
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
}
if (indexRestoreNeeded)
global.indexRunner->pauseIndexing = indexPauseSave;
return false;
}