Skip to content

Commit

Permalink
[ISSUE openmessaging#272]Fix NamedThreadFactory attribute typo
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsm committed Feb 4, 2023
1 parent 8b6991a commit 2190569
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ public class NamedThreadFactory implements ThreadFactory {

private final String threadNamePrefix;

private final boolean isDemoThread;
private final boolean isDaemonThread;

public NamedThreadFactory(final String threadNamePrefix, boolean isDemoThread) {
this(new AtomicInteger(0), threadNamePrefix, isDemoThread);
public NamedThreadFactory(final String threadNamePrefix, boolean isDaemonThread) {
this(new AtomicInteger(0), threadNamePrefix, isDaemonThread);
}

public NamedThreadFactory(AtomicInteger threadIndex, final String threadNamePrefix, boolean isDemoThread) {
public NamedThreadFactory(AtomicInteger threadIndex, final String threadNamePrefix, boolean isDaemonThread) {
this.threadIndex = threadIndex;
this.threadNamePrefix = threadNamePrefix;
this.isDemoThread = isDemoThread;
this.isDaemonThread = isDaemonThread;
}

public NamedThreadFactory(final String threadNamePrefix) {
Expand All @@ -56,7 +56,7 @@ public Thread newThread(Runnable r) {
threadName.append("-").append(threadIndex.incrementAndGet());
}
Thread thread = new Thread(r, threadName.toString());
if (isDemoThread) {
if (isDaemonThread) {
thread.setDaemon(true);
}
return thread;
Expand Down

0 comments on commit 2190569

Please sign in to comment.