Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/jcl/src/java.base/share/classes/java/lang/ref/Finalizer.java
12521 views
1
/*[INCLUDE-IF Sidecar16]*/
2
package java.lang.ref;
3
4
/*******************************************************************************
5
* Copyright (c) 2002, 2016 IBM Corp. and others
6
*
7
* This program and the accompanying materials are made available under
8
* the terms of the Eclipse Public License 2.0 which accompanies this
9
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
10
* or the Apache License, Version 2.0 which accompanies this distribution and
11
* is available at https://www.apache.org/licenses/LICENSE-2.0.
12
*
13
* This Source Code may also be made available under the following
14
* Secondary Licenses when the conditions for such availability set
15
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
16
* General Public License, version 2 with the GNU Classpath
17
* Exception [1] and GNU General Public License, version 2 with the
18
* OpenJDK Assembly Exception [2].
19
*
20
* [1] https://www.gnu.org/software/classpath/license.html
21
* [2] http://openjdk.java.net/legal/assembly-exception.html
22
*
23
* 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-exception
24
*******************************************************************************/
25
26
final class Finalizer {
27
28
// called by java.lang.Runtime.runFinalization0
29
static void runFinalization() {
30
runFinalizationImpl();
31
}
32
33
private static native void runFinalizationImpl();
34
35
// called by java.lang.Shutdown.runAllFinalizers native
36
// invoked when Runtime.runFinalizersOnExit() was called with true
37
static void runAllFinalizers() {
38
runAllFinalizersImpl();
39
}
40
41
static ReferenceQueue<Object> getQueue() {
42
return new ReferenceQueue<Object>();
43
}
44
45
private static native void runAllFinalizersImpl();
46
}
47
48