transitionIf

fun STM.transitionIf(from: S, to: S): Boolean(source)

Transitions from from to to only if the current state equals from. Returns true if the transition occurred, false otherwise.