CORDA-1004 Use FastThreadLocalThread in multi-thread SMM. (#492)

This commit is contained in:
Andrzej Cichocki 2018-03-01 17:35:41 +00:00 committed by GitHub
parent 8239c5d29f
commit 26a11bccc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,6 +7,7 @@ import com.codahale.metrics.graphite.PickledGraphite
import com.google.common.util.concurrent.ThreadFactoryBuilder
import com.jcraft.jsch.JSch
import com.jcraft.jsch.JSchException
import io.netty.util.concurrent.FastThreadLocalThread
import net.corda.core.crypto.newSecureRandom
import net.corda.core.identity.CordaX500Name
import net.corda.core.internal.Emoji
@ -23,7 +24,6 @@ import org.fusesource.jansi.Ansi
import org.fusesource.jansi.AnsiConsole
import java.io.IOException
import java.net.Inet6Address
import java.net.InetAddress
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
import java.util.concurrent.TimeUnit
@ -166,7 +166,7 @@ D""".trimStart()
private fun makeStateMachineExecutorService(): ExecutorService {
return Executors.newFixedThreadPool(
configuration.enterpriseConfiguration.tuning.flowThreadPoolSize,
ThreadFactoryBuilder().setNameFormat("flow-executor-%d").build()
ThreadFactoryBuilder().setNameFormat("flow-executor-%d").setThreadFactory(::FastThreadLocalThread).build()
)
}