Scala : Explicit thread handling