src/java.prefs/unix/classes/java/util/prefs/FileSystemPreferences.java

Print this page
rev 13541 : 8147545: Remove sun.misc.ManagedLocalsThread from java.prefs
Summary: Replace ManagedLocalsThread with Thread(null,null,threadName,0,false)
Reviewed-by: XXX

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -28,11 +28,10 @@
 import java.io.*;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.security.PrivilegedExceptionAction;
 import java.security.PrivilegedActionException;
-import sun.misc.ManagedLocalsThread;
 import sun.util.logging.PlatformLogger;
 
 /**
  * Preferences implementation for Unix.  Preferences are stored in the file
  * system, with one directory per preferences node.  All of the preferences

@@ -441,11 +440,12 @@
         }, SYNC_INTERVAL*1000, SYNC_INTERVAL*1000);
 
         // Add shutdown hook to flush cached prefs on normal termination
         AccessController.doPrivileged(new PrivilegedAction<Void>() {
             public Void run() {
-                Runtime.getRuntime().addShutdownHook(new ManagedLocalsThread() {
+                Runtime.getRuntime().addShutdownHook(
+                    new Thread(null, null, "Sync Timer Thread", 0, false) {
                     public void run() {
                         syncTimer.cancel();
                         syncWorld();
                     }
                 });