Path: blob/master/jcl/src/java.base/share/classes/java/lang/ref/Finalizer.java
12521 views
/*[INCLUDE-IF Sidecar16]*/1package java.lang.ref;23/*******************************************************************************4* Copyright (c) 2002, 2016 IBM Corp. and others5*6* This program and the accompanying materials are made available under7* the terms of the Eclipse Public License 2.0 which accompanies this8* distribution and is available at https://www.eclipse.org/legal/epl-2.0/9* or the Apache License, Version 2.0 which accompanies this distribution and10* is available at https://www.apache.org/licenses/LICENSE-2.0.11*12* This Source Code may also be made available under the following13* Secondary Licenses when the conditions for such availability set14* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU15* General Public License, version 2 with the GNU Classpath16* Exception [1] and GNU General Public License, version 2 with the17* OpenJDK Assembly Exception [2].18*19* [1] https://www.gnu.org/software/classpath/license.html20* [2] http://openjdk.java.net/legal/assembly-exception.html21*22* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception23*******************************************************************************/2425final class Finalizer {2627// called by java.lang.Runtime.runFinalization028static void runFinalization() {29runFinalizationImpl();30}3132private static native void runFinalizationImpl();3334// called by java.lang.Shutdown.runAllFinalizers native35// invoked when Runtime.runFinalizersOnExit() was called with true36static void runAllFinalizers() {37runAllFinalizersImpl();38}3940static ReferenceQueue<Object> getQueue() {41return new ReferenceQueue<Object>();42}4344private static native void runAllFinalizersImpl();45}464748