Skip to content

Instantly share code, notes, and snippets.

@longshorej
Created September 22, 2014 15:27
Show Gist options
  • Save longshorej/c7f1b5195b069d18130f to your computer and use it in GitHub Desktop.
Save longshorej/c7f1b5195b069d18130f to your computer and use it in GitHub Desktop.
scala repl threads
def threaded(numThreads: Int)(block: => Unit) = {
val threads = for (n <- 1 to numThreads) yield new Thread(new Runnable {
def run() = block
})
threads foreach (_.start())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment