<commit_before>/* Copyright 2004 The JA-SIG Collaborative.  All rights reserved.
 * See license distributed with this file and
 * available online at http://www.uportal.org/license.html
 */
package org.jasig.portal.utils.threading;

import edu.emory.mathcs.backport.java.util.concurrent.ThreadFactory;

/**
 * Implementation of a ThreadFactory that allows you to set the thread
 * priority.
 * 
 * @author <NAME>
 * @version $Revision$ $Date$
 *
 */
public class PriorityThreadFactory implements ThreadFactory {
    private final int threadPriority;
    
    public PriorityThreadFactory(int threadPriority) {
        this.threadPriority = threadPriority;
    }

    public Thread newThread(Runnable runnable) {
        Thread t = new Thread(runnable);
        t.setPriority(this.threadPriority);
        return t;
    }
}<commit_msg>UP-1156, changed thread to daemon to allow tomcat to shutdown<commit_after>/* Copyright 2004 The JA-SIG Collaborative.  All rights reserved.
 * See license distributed with this file and
 * available online at http://www.uportal.org/license.html
 */
package org.jasig.portal.utils.threading;

import edu.emory.mathcs.backport.java.util.concurrent.ThreadFactory;

/**
 * Implementation of a ThreadFactory that allows you to set the thread
 * priority.
 * 
 * @author <NAME>
 * @version $Revision$ $Date$
 *
 */
public class PriorityThreadFactory implements ThreadFactory {
    private final int threadPriority;
    
    public PriorityThreadFactory(int threadPriority) {
        this.threadPriority = threadPriority;
    }

    public Thread newThread(Runnable runnable) {
        Thread t = new Thread(runnable);
        t.setPriority(this.threadPriority);
        t.setDaemon(true);
        return t;
    }
}
{'fraction_non_alphanumeric': 0.09064830751577739, 'fraction_numerical': 0.0068846815834767644, 'mean_word_length': 3.4832904884318765, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7487760', 'n_tokens_mistral': 507, 'n_tokens_neox': 476, 'n_words': 142}