Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.jruby.threading;
 
A ThreadFactory for when we're using pooled threads; we want to create the threads with daemon = true so they don't keep us from shutting down.
 
public class DaemonThreadFactory implements ThreadFactory {
    private final AtomicInteger count = new AtomicInteger(1);
    private final String name;
    public DaemonThreadFactory(String name) {
        this. = name;
    }
    public DaemonThreadFactory() {
        this. = "JRubyWorker";
    }
    public Thread newThread(Runnable runnable) {
        Thread thread = new Thread(runnable);
        thread.setName( + "-" + .getAndIncrement());
        thread.setDaemon(true);
        return thread;
    }
New to GrepCode? Check out our FAQ X