src/java.desktop/unix/classes/sun/awt/X11/UnsafeXDisposerRecord.java

Print this page
rev 12972 : 8140606: Update library code to use internal Unsafe
Reviewed-by: duke


   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 package sun.awt.X11;
  26 
  27 import sun.misc.Unsafe;
  28 import sun.util.logging.PlatformLogger;
  29 
  30 class UnsafeXDisposerRecord implements sun.java2d.DisposerRecord {
  31     private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.UnsafeXDisposerRecord");
  32     private static Unsafe unsafe = XlibWrapper.unsafe;
  33     final long[] unsafe_ptrs, x_ptrs;
  34     final String name;
  35     volatile boolean disposed;
  36     final Throwable place;
  37     public UnsafeXDisposerRecord(String name, long[] unsafe_ptrs, long[] x_ptrs) {
  38         this.unsafe_ptrs = unsafe_ptrs;
  39         this.x_ptrs = x_ptrs;
  40         this.name = name;
  41         if (XlibWrapper.isBuildInternal) {
  42             place = new Throwable();
  43         } else {
  44             place = null;
  45         }
  46     }
  47     public UnsafeXDisposerRecord(String name, long ... unsafe_ptrs) {




   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 package sun.awt.X11;
  26 
  27 import jdk.internal.misc.Unsafe;
  28 import sun.util.logging.PlatformLogger;
  29 
  30 class UnsafeXDisposerRecord implements sun.java2d.DisposerRecord {
  31     private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.UnsafeXDisposerRecord");
  32     private static Unsafe unsafe = XlibWrapper.unsafe;
  33     final long[] unsafe_ptrs, x_ptrs;
  34     final String name;
  35     volatile boolean disposed;
  36     final Throwable place;
  37     public UnsafeXDisposerRecord(String name, long[] unsafe_ptrs, long[] x_ptrs) {
  38         this.unsafe_ptrs = unsafe_ptrs;
  39         this.x_ptrs = x_ptrs;
  40         this.name = name;
  41         if (XlibWrapper.isBuildInternal) {
  42             place = new Throwable();
  43         } else {
  44             place = null;
  45         }
  46     }
  47     public UnsafeXDisposerRecord(String name, long ... unsafe_ptrs) {