void completeTermination() { assert ! holdsLock(headLock) && ! holdsLock(tailLock); // be kind and un-interrupt the thread for the termination task Thread.interrupted(); final Runnable terminationTask = this.terminationTask; this.terminationTask = null; safeRun(terminationTask); // notify all waiters Waiter waiters = getAndSetTerminationWaiters(TERMINATE_COMPLETE_WAITER); while (waiters != null) { unpark(waiters.getThread()); waiters = waiters.getNext(); } tail.getAndSetNext(TERMINATE_COMPLETE); final ObjectInstance handle = this.handle; if (handle != null) { doPrivileged(new PrivilegedAction<Void>() { public Void run() { try { ManagementFactory.getPlatformMBeanServer().unregisterMBean(handle.getObjectName()); } catch (Throwable ignored) { } return null; } }, acc); } }
void completeTermination() { assert ! holdsLock(headLock) && ! holdsLock(tailLock); // be kind and un-interrupt the thread for the termination task Thread.interrupted(); final Runnable terminationTask = this.terminationTask; this.terminationTask = null; safeRun(terminationTask); // notify all waiters Waiter waiters = getAndSetTerminationWaiters(TERMINATE_COMPLETE_WAITER); while (waiters != null) { unpark(waiters.getThread()); waiters = waiters.getNext(); } tail.getAndSetNext(TERMINATE_COMPLETE); final ObjectInstance handle = this.handle; if (handle != null) { doPrivileged(new PrivilegedAction<Void>() { public Void run() { try { ManagementFactory.getPlatformMBeanServer().unregisterMBean(handle.getObjectName()); } catch (Throwable ignored) { } return null; } }, acc); } }