< prev index next >

src/java.base/share/classes/sun/nio/ch/Util.java

Print this page
rev 13549 : 8148117: Move sun.misc.Cleaner to jdk.internal.ref
Reviewed-by: alanb, rriggs


  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 
  26 package sun.nio.ch;
  27 
  28 import java.lang.reflect.*;
  29 import java.io.FileDescriptor;
  30 import java.nio.ByteBuffer;
  31 import java.nio.MappedByteBuffer;
  32 import java.security.AccessController;
  33 import java.security.PrivilegedAction;
  34 import java.util.*;
  35 import jdk.internal.misc.Unsafe;
  36 import sun.misc.Cleaner;
  37 import sun.security.action.GetPropertyAction;
  38 
  39 
  40 public class Util {
  41 
  42     // -- Caches --
  43 
  44     // The number of temp buffers in our pool
  45     private static final int TEMP_BUF_POOL_SIZE = IOUtil.IOV_MAX;
  46 
  47     // Per-thread cache of temporary direct buffers
  48     private static ThreadLocal<BufferCache> bufferCache =
  49         new ThreadLocal<BufferCache>()
  50     {
  51         @Override
  52         protected BufferCache initialValue() {
  53             return new BufferCache();
  54         }
  55     };
  56 




  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 
  26 package sun.nio.ch;
  27 
  28 import java.lang.reflect.*;
  29 import java.io.FileDescriptor;
  30 import java.nio.ByteBuffer;
  31 import java.nio.MappedByteBuffer;
  32 import java.security.AccessController;
  33 import java.security.PrivilegedAction;
  34 import java.util.*;
  35 import jdk.internal.misc.Unsafe;
  36 import jdk.internal.ref.Cleaner;
  37 import sun.security.action.GetPropertyAction;
  38 
  39 
  40 public class Util {
  41 
  42     // -- Caches --
  43 
  44     // The number of temp buffers in our pool
  45     private static final int TEMP_BUF_POOL_SIZE = IOUtil.IOV_MAX;
  46 
  47     // Per-thread cache of temporary direct buffers
  48     private static ThreadLocal<BufferCache> bufferCache =
  49         new ThreadLocal<BufferCache>()
  50     {
  51         @Override
  52         protected BufferCache initialValue() {
  53             return new BufferCache();
  54         }
  55     };
  56 


< prev index next >