File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 55This document provides a high-level view of the changes to the {project-name} by release.
66For a detailed view of what has changed, refer to the {uri-repo} /commits/master[commit history] on GitHub.
77
8+ == Unreleased
9+
10+ * fix watchdog race condition leading to `ThreadError(<killed thread>)` on JRuby ({uri-repo}/pull/215[#215])
11+
812== 2.0.0.rc2 (2021-01-07) - @slonopotamus
913
1014* Fix release workflow
Original file line number Diff line number Diff line change @@ -227,15 +227,17 @@ def highlight(code, opts = {})
227227 def with_watchdog ( timeout_time , error_message )
228228 state_mutex = Mutex . new
229229 state = :alive
230+ wd_cleanup = ConditionVariable . new
230231
231232 watchdog = timeout_time > 0 ? Thread . new do
232233 state_mutex . synchronize do
233- state_mutex . sleep ( timeout_time ) if state != :finished
234+ wd_cleanup . wait ( state_mutex , timeout_time ) if state != :finished
234235 if state != :finished
235236 @log . error error_message
236237 stop error_message
237238 state = :timeout
238239 end
240+
239241 end
240242 end : nil
241243 begin
@@ -244,7 +246,8 @@ def with_watchdog(timeout_time, error_message)
244246 if watchdog
245247 state_mutex . synchronize do
246248 state = :finished if state == :alive
247- watchdog . wakeup if watchdog . alive?
249+ # wake up watchdog thread
250+ wd_cleanup . signal
248251 end
249252 watchdog . join
250253 end
You can’t perform that action at this time.
0 commit comments