tom | 5f38b3a | 2014-08-27 23:50:54 -0700 | [diff] [blame^] | 1 | package org.onlab.util; |
| 2 | |
| 3 | import com.google.common.util.concurrent.ThreadFactoryBuilder; |
| 4 | |
| 5 | import java.util.concurrent.ThreadFactory; |
| 6 | |
| 7 | public abstract class Tools { |
| 8 | |
| 9 | private Tools() { |
| 10 | } |
| 11 | |
| 12 | /** |
| 13 | * Returns a thread factory that produces threads named according to the |
| 14 | * supplied name pattern. |
| 15 | * |
| 16 | * @param pattern name pattern |
| 17 | * @return thread factory |
| 18 | */ |
| 19 | public static ThreadFactory namedThreads(String pattern) { |
| 20 | return new ThreadFactoryBuilder().setNameFormat(pattern).build(); |
| 21 | } |
| 22 | |
| 23 | } |