LoopHelpers.java revision 3203
5612N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 5612N/A * This code is free software; you can redistribute it and/or modify it 6254N/A * under the terms of the GNU General Public License version 2 only, as 5612N/A * published by the Free Software Foundation. 5612N/A * This code is distributed in the hope that it will be useful, but WITHOUT 5612N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 6254N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 5612N/A * version 2 for more details (a copy is included in the LICENSE file that 5612N/A * You should have received a copy of the GNU General Public License version 5612N/A * 2 along with this work; if not, write to the Free Software Foundation, 5612N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 5612N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 5612N/A * or visit www.oracle.com if you need additional information or have any 5612N/A * This file is available under and governed by the GNU General Public 5612N/A * License version 2 only, as published by the Free Software Foundation. 5612N/A * However, the following notice accompanied the original version of this 5612N/A * Written by Doug Lea with assistance from members of JCP JSR-166 5612N/A * Expert Group and released to the public domain, as explained at 5612N/A * Misc utilities in JSR166 performance tests 5612N/A // Some mindless computation to do between synchronizations... 5612N/A * generates 32 bit pseudo-random numbers. 5612N/A * Computes a linear congruential random number a random number 5612N/A x = (x *
2147483647) %
16807;
5612N/A * An actually useful random number generator, but unsynchronized. 5612N/A * Basically same as java.util.Random. 5612N/A private static final long mask = (
1L <<
48) -
1;
// There's probably a better way to do this...