Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
1.1.0
Description
There is a chance that `thread` is null when calling `thread.interrupt()`.
override def cancel(): Unit = this.synchronized { _cancelled = true if (thread != null) { thread.interrupt() } }
Should put `thread = null` into a `synchronized` block to fix the race condition.
try { p.success(func) } catch { case e: Exception => p.failure(e) } finally { thread = null }