mirror of https://github.com/sbt/sbt.git
Merge pull request #5288 from eatkins/shutdown-hook-type-annotation
Add type annotation for shutdown hooks
This commit is contained in:
commit
f0d1e075db
|
|
@ -38,7 +38,7 @@ private[sbt] object ShutdownHooks extends AutoCloseable {
|
||||||
() => Option(hooks.remove(id)).foreach(_.apply())
|
() => Option(hooks.remove(id)).foreach(_.apply())
|
||||||
}
|
}
|
||||||
private def runAll(): Unit = if (ranHooks.compareAndSet(false, true)) {
|
private def runAll(): Unit = if (ranHooks.compareAndSet(false, true)) {
|
||||||
hooks.forEachValue(runtime.availableProcessors.toLong, _.apply())
|
hooks.forEachValue(runtime.availableProcessors.toLong, (_: () => Unit).apply())
|
||||||
}
|
}
|
||||||
override def close(): Unit = {
|
override def close(): Unit = {
|
||||||
runtime.removeShutdownHook(thread)
|
runtime.removeShutdownHook(thread)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue