2362N/A * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A same package as the Reference 0N/A /* A native method that invokes an arbitrary object's finalize method is 0N/A required since the finalize method is protected 0N/A this.
next =
this;
/* Indicates that this has been finalized */ 0N/A synchronized (
this) {
0N/A /* Clear stack slot containing this variable, to decrease 0N/A the chances of false retention with a conservative GC */ 0N/A /* Create a privileged secondary finalizer thread in the system thread 0N/A group for the given Runnable, and wait for it to complete. 0N/A This method is used by both runFinalization and runFinalizersOnExit. 0N/A The former method invokes all pending finalizers, while the latter 0N/A invokes all uninvoked finalizers if on-exit finalization has been 0N/A These two methods could have been implemented by offloading their work 0N/A to the regular finalizer thread and waiting for that thread to finish. 0N/A The advantage of creating a fresh thread, however, is that it insulates 0N/A invokers of these methods from a stalled or deadlocked finalizer thread. 0N/A /* Called by Runtime.runFinalization() */ 0N/A /* Invoked by java.lang.Shutdown */ 0N/A super(g,
"Finalizer");