diff options
Diffstat (limited to 'src/universe.cpp')
-rw-r--r-- | src/universe.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/universe.cpp b/src/universe.cpp index 6adc314..becffdd 100644 --- a/src/universe.cpp +++ b/src/universe.cpp | |||
@@ -89,13 +89,12 @@ void Universe::terminateFreeRunningLanes(lua_State* L_, lua_Duration shutdownTim | |||
89 | { | 89 | { |
90 | std::lock_guard<std::mutex> guard{ selfdestructMutex }; | 90 | std::lock_guard<std::mutex> guard{ selfdestructMutex }; |
91 | Lane* lane{ selfdestructFirst }; | 91 | Lane* lane{ selfdestructFirst }; |
92 | lua_Duration timeout{ 1us }; | ||
93 | while (lane != SELFDESTRUCT_END) { | 92 | while (lane != SELFDESTRUCT_END) { |
94 | // attempt the requested cancel with a small timeout. | 93 | // attempt the requested cancel with a small timeout. |
95 | // if waiting on a linda, they will raise a cancel_error. | 94 | // if waiting on a linda, they will raise a cancel_error. |
96 | // if a cancellation hook is desired, it will be installed to try to raise an error | 95 | // if a cancellation hook is desired, it will be installed to try to raise an error |
97 | if (lane->thread.joinable()) { | 96 | if (lane->thread.joinable()) { |
98 | std::ignore = thread_cancel(lane, op_, 1, timeout, true); | 97 | std::ignore = thread_cancel(lane, op_, 1, std::chrono::steady_clock::now() + 1us, true); |
99 | } | 98 | } |
100 | lane = lane->selfdestruct_next; | 99 | lane = lane->selfdestruct_next; |
101 | } | 100 | } |