Skip to content

Commit

Permalink
fix: revert change to removeAllKeys
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-py committed May 4, 2019
1 parent 6736cd7 commit bb472bd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion shared/src/main/scala/com/olegpy/stm/internal/Monitor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@ class Monitor private[stm] () {

def removeAllKeys(): Unit = {
val j = store.current()
j.read(this).asInstanceOf[Set[AnyRef @unchecked]].foreach(removeFromSet(_, this))
j.read(this) match {
case set: Set[AnyRef @unchecked] => set.foreach(removeFromSet(_, this))
// This might not be hit in a single test run, avoid fluctuating coverage
// $COVERAGE-OFF$
case _ =>
// $COVERAGE-ON$
}
j.update(this, null)
}
}
Expand Down

0 comments on commit bb472bd

Please sign in to comment.