aboutsummaryrefslogtreecommitdiff
path: root/src/universe.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/universe.cpp')
-rw-r--r--src/universe.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/universe.cpp b/src/universe.cpp
index 548475e..0bab844 100644
--- a/src/universe.cpp
+++ b/src/universe.cpp
@@ -322,20 +322,20 @@ void Universe::terminateFreeRunningLanes(lua_State* L_, lua_Duration shutdownTim
322 // give threads time to act on their cancel 322 // give threads time to act on their cancel
323 std::this_thread::yield(); 323 std::this_thread::yield();
324 // count the number of cancelled thread that didn't have the time to act yet 324 // count the number of cancelled thread that didn't have the time to act yet
325 int n{ 0 }; 325 int _n{ 0 };
326 { 326 {
327 std::lock_guard<std::mutex> _guard{ selfdestructMutex }; 327 std::lock_guard<std::mutex> _guard{ selfdestructMutex };
328 Lane* _lane{ selfdestructFirst }; 328 Lane* _lane{ selfdestructFirst };
329 while (_lane != SELFDESTRUCT_END) { 329 while (_lane != SELFDESTRUCT_END) {
330 if (_lane->cancelRequest != CancelRequest::None) 330 if (_lane->cancelRequest != CancelRequest::None)
331 ++n; 331 ++_n;
332 _lane = _lane->selfdestruct_next; 332 _lane = _lane->selfdestruct_next;
333 } 333 }
334 } 334 }
335 // if timeout elapsed, or we know all threads have acted, stop waiting 335 // if timeout elapsed, or we know all threads have acted, stop waiting
336 std::chrono::time_point<std::chrono::steady_clock> _now = std::chrono::steady_clock::now(); 336 std::chrono::time_point<std::chrono::steady_clock> _now = std::chrono::steady_clock::now();
337 if (n == 0 || (_now >= _until)) { 337 if (_n == 0 || (_now >= _until)) {
338 DEBUGSPEW_CODE(fprintf(stderr, "%d uncancelled lane(s) remain after waiting %fs at process end.\n", n, shutdownTimeout_.count())); 338 DEBUGSPEW_CODE(DebugSpew(this) << _n << " uncancelled lane(s) remain after waiting " << shutdownTimeout_.count() << "s at process end." << std::endl);
339 break; 339 break;
340 } 340 }
341 } 341 }
@@ -354,7 +354,7 @@ void Universe::terminateFreeRunningLanes(lua_State* L_, lua_Duration shutdownTim
354 Lane* _lane{ selfdestructFirst }; 354 Lane* _lane{ selfdestructFirst };
355 if (_lane != SELFDESTRUCT_END) { 355 if (_lane != SELFDESTRUCT_END) {
356 // this causes a leak because we don't call U's destructor (which could be bad if the still running lanes are accessing it) 356 // this causes a leak because we don't call U's destructor (which could be bad if the still running lanes are accessing it)
357 raise_luaL_error(L_, "Zombie thread %s refuses to die!", _lane->debugName.data()); 357 raise_luaL_error(L_, "Zombie thread " STRINGVIEW_FMT " refuses to die!", _lane->debugName.size(), _lane->debugName.data());
358 } 358 }
359 } 359 }
360} 360}