@Test public void newThread() throws Exception { NamedInternalThreadFactory namedInternalThreadFactory = new NamedInternalThreadFactory(); Thread t = namedInternalThreadFactory.newThread(new Runnable() { @Override public void run() { } }); Assert.assertTrue("thread is not InternalThread", t.getClass().equals(InternalThread.class)); }
@Override public Thread newThread(Runnable runnable) { String name = mPrefix + mThreadNum.getAndIncrement(); InternalThread ret = new InternalThread(mGroup, runnable, name, 0); ret.setDaemon(mDaemon); return ret; }
NamedInternalThreadFactory extends NamedThreadFactory { @Override public Thread newThread(Runnable runnable) { String name = mPrefix + mThreadNum.getAndIncrement(); InternalThread ret = new InternalThread(mGroup, runnable, name, 0); ret.setDaemon(mDaemon); return ret; } }
NamedInternalThreadFactory extends NamedThreadFactory { @Override public Thread newThread(Runnable runnable) { String name = mPrefix + mThreadNum.getAndIncrement(); InternalThread ret = new InternalThread(mGroup, runnable, name, 0); ret.setDaemon(mDaemon); return ret; } NamedInternalThreadFactory();  NamedInternalThreadFactory(String prefix);  NamedInternalThreadFactory(String prefix, boolean daemon); }
NamedInternalThreadFactory extends NamedThreadFactory { @Override public Thread newThread(Runnable runnable) { String name = mPrefix + mThreadNum.getAndIncrement(); InternalThread ret = new InternalThread(mGroup, runnable, name, 0); ret.setDaemon(mDaemon); return ret; } NamedInternalThreadFactory();  NamedInternalThreadFactory(String prefix);  NamedInternalThreadFactory(String prefix, boolean daemon); @Override Thread newThread(Runnable runnable); }
NamedInternalThreadFactory extends NamedThreadFactory { @Override public Thread newThread(Runnable runnable) { String name = mPrefix + mThreadNum.getAndIncrement(); InternalThread ret = new InternalThread(mGroup, runnable, name, 0); ret.setDaemon(mDaemon); return ret; } NamedInternalThreadFactory();  NamedInternalThreadFactory(String prefix);  NamedInternalThreadFactory(String prefix, boolean daemon); @Override Thread newThread(Runnable runnable);  }