jdk/src/java.prefs/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java
changeset 35311 613162418a3d
parent 29919 be906afc335b
equal deleted inserted replaced
35310:24e6bd6c0b75 35311:613162418a3d
     1 /*
     1 /*
     2  * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    29 import java.util.HashSet;
    29 import java.util.HashSet;
    30 import java.util.Iterator;
    30 import java.util.Iterator;
    31 import java.util.Timer;
    31 import java.util.Timer;
    32 import java.util.TimerTask;
    32 import java.util.TimerTask;
    33 import java.lang.ref.WeakReference;
    33 import java.lang.ref.WeakReference;
    34 import sun.misc.ManagedLocalsThread;
       
    35 
    34 
    36 
    35 
    37 /*
    36 /*
    38   MacOSXPreferencesFile synchronization:
    37   MacOSXPreferencesFile synchronization:
    39 
    38 
   342     // Return the timer used for flush and sync, creating it if necessary.
   341     // Return the timer used for flush and sync, creating it if necessary.
   343     private static synchronized Timer timer()
   342     private static synchronized Timer timer()
   344     {
   343     {
   345         if (timer == null) {
   344         if (timer == null) {
   346             timer = new Timer(true); // daemon
   345             timer = new Timer(true); // daemon
   347             Thread flushThread = new ManagedLocalsThread() {
   346             Thread flushThread =
       
   347                 new Thread(null, null, "Flush Thread", 0, false) {
   348                 @Override
   348                 @Override
   349                 public void run() {
   349                 public void run() {
   350                     flushWorld();
   350                     flushWorld();
   351                 }
   351                 }
   352             };
   352             };