History

one more crack at fixing false deadlock

Brad Hefta-Gaub committed 10 years ago

Commit f7e6f601 parent bb42d841 file · +4 −4Browse files

Showing the changes to interface/src/Application.cpp (1 of 1 file). Show all

Unified · Split

interface/src/Application.cpp+4−4
@@ -270,10 +270,10 @@ public: · 269 unmodified lines
270 void run() override {270 void run() override {
271 while (!_quit) {271 while (!_quit) {
272 QThread::sleep(HEARTBEAT_UPDATE_INTERVAL_SECS);272 QThread::sleep(HEARTBEAT_UPDATE_INTERVAL_SECS);
273 auto now = usecTimestampNow();
274 273
275 // in the unlikely event that now is less than _heartbeat, don't rollover and confuse ourselves274 uint64_t lastHeartbeat = _heartbeat; // sample atomic _heartbeat, because we could context switch away and have it updated on us
276 auto lastHeartbeatAge = (now > _heartbeat) ? now - _heartbeat : 0; 275 uint64_t now = usecTimestampNow();
276 auto lastHeartbeatAge = (now > lastHeartbeat) ? now - lastHeartbeat : 0;
277 auto sinceLastReport = (now > _lastReport) ? now - _lastReport : 0;277 auto sinceLastReport = (now > _lastReport) ? now - _lastReport : 0;
278 auto elapsedMovingAverage = _movingAverage.getAverage();278 auto elapsedMovingAverage = _movingAverage.getAverage();
279 279
@@ -310,7 +310,7 @@ public: · 30 unmodified lines
310 if (lastHeartbeatAge > MAX_HEARTBEAT_AGE_USECS) {310 if (lastHeartbeatAge > MAX_HEARTBEAT_AGE_USECS) {
311 qDebug() << "DEADLOCK DETECTED -- "311 qDebug() << "DEADLOCK DETECTED -- "
312 << "lastHeartbeatAge:" << lastHeartbeatAge312 << "lastHeartbeatAge:" << lastHeartbeatAge
313 << "[ _heartbeat:" << _heartbeat313 << "[ lastHeartbeat :" << lastHeartbeat
314 << "now:" << now << " ]"314 << "now:" << now << " ]"
315 << "elapsedMovingAverage:" << elapsedMovingAverage315 << "elapsedMovingAverage:" << elapsedMovingAverage
316 << "maxElapsed:" << _maxElapsed316 << "maxElapsed:" << _maxElapsed

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t