void safeRun(final Runnable task) { assert ! holdsLock(headLock) && ! holdsLock(tailLock); try { if (task != null) task.run(); } catch (Throwable t) { try { exceptionHandler.uncaughtException(Thread.currentThread(), t); } catch (Throwable ignored) { // nothing else we can safely do here } } finally { // clear TCCL JBossExecutors.clearContextClassLoader(Thread.currentThread()); // clear interrupt status Thread.interrupted(); } }
private Thread createThread(final Runnable target) { final ThreadNameInfo nameInfo = new ThreadNameInfo(globalThreadIndexSequence.getAndIncrement(), factoryThreadIndexSequence.getAndIncrement(), factoryIndex); final JBossThread thread; if (stackSize != null) { thread = new JBossThread(threadGroup, target, "<new>", stackSize.longValue()); } else { thread = new JBossThread(threadGroup, target); } thread.setThreadNameInfo(nameInfo); thread.setName(nameInfo.format(thread, namePattern)); if (initialPriority != null) thread.setPriority(initialPriority.intValue()); if (daemon != null) thread.setDaemon(daemon.booleanValue()); if (uncaughtExceptionHandler != null) thread.setUncaughtExceptionHandler(uncaughtExceptionHandler); JBossExecutors.clearContextClassLoader(thread); return thread; } }
JBossExecutors.clearContextClassLoader(currentThread);
void safeRun(final Runnable task) { assert ! holdsLock(headLock) && ! holdsLock(tailLock); try { if (task != null) task.run(); } catch (Throwable t) { try { exceptionHandler.uncaughtException(Thread.currentThread(), t); } catch (Throwable ignored) { // nothing else we can safely do here } } finally { // clear TCCL JBossExecutors.clearContextClassLoader(Thread.currentThread()); // clear interrupt status Thread.interrupted(); } }
void safeRun(final Runnable task) { assert ! holdsLock(headLock) && ! holdsLock(tailLock); try { if (task != null) task.run(); } catch (Throwable t) { try { exceptionHandler.uncaughtException(Thread.currentThread(), t); } catch (Throwable ignored) { // nothing else we can safely do here } } finally { // clear TCCL JBossExecutors.clearContextClassLoader(Thread.currentThread()); // clear interrupt status Thread.interrupted(); } }
private Thread createThread(final Runnable target) { final ThreadNameInfo nameInfo = new ThreadNameInfo(globalThreadIndexSequence.getAndIncrement(), factoryThreadIndexSequence.getAndIncrement(), factoryIndex); final JBossThread thread; if (stackSize != null) { thread = new JBossThread(threadGroup, target, "<new>", stackSize.longValue()); } else { thread = new JBossThread(threadGroup, target); } thread.setThreadNameInfo(nameInfo); thread.setName(nameInfo.format(thread, namePattern)); if (initialPriority != null) thread.setPriority(initialPriority.intValue()); if (daemon != null) thread.setDaemon(daemon.booleanValue()); if (uncaughtExceptionHandler != null) thread.setUncaughtExceptionHandler(uncaughtExceptionHandler); JBossExecutors.clearContextClassLoader(thread); return thread; } }
private Thread createThread(final Runnable target) { final ThreadNameInfo nameInfo = new ThreadNameInfo(globalThreadIndexSequence.getAndIncrement(), factoryThreadIndexSequence.getAndIncrement(), factoryIndex); final JBossThread thread; if (stackSize != null) { thread = new JBossThread(threadGroup, target, "<new>", stackSize.longValue()); } else { thread = new JBossThread(threadGroup, target); } thread.setThreadNameInfo(nameInfo); thread.setName(nameInfo.format(thread, namePattern)); if (initialPriority != null) thread.setPriority(initialPriority.intValue()); if (daemon != null) thread.setDaemon(daemon.booleanValue()); if (uncaughtExceptionHandler != null) thread.setUncaughtExceptionHandler(uncaughtExceptionHandler); JBossExecutors.clearContextClassLoader(thread); return thread; } }
JBossExecutors.clearContextClassLoader(currentThread);
JBossExecutors.clearContextClassLoader(currentThread);