< prev index next >

test/hotspot/gtest/utilities/test_concurrentHashtable.cpp

Print this page




  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 #include "precompiled.hpp"
  25 #include "runtime/mutex.hpp"
  26 #include "runtime/semaphore.hpp"
  27 #include "runtime/thread.hpp"
  28 #include "runtime/vmThread.hpp"
  29 #include "runtime/vm_operations.hpp"
  30 #include "utilities/concurrentHashTable.inline.hpp"
  31 #include "utilities/concurrentHashTableTasks.inline.hpp"
  32 #include "utilitiesHelper.inline.hpp"
  33 #include "unittest.hpp"
  34 
  35 // NOTE: On win32 gtest asserts are not mt-safe.
  36 // Amusingly as long as they do not assert they are mt-safe.
  37 #define SIZE_32 5
  38 
  39 struct Pointer;
  40 
  41 typedef ConcurrentHashTable<uintptr_t, Pointer, mtInternal> SimpleTestTable;
  42 typedef ConcurrentHashTable<uintptr_t, Pointer, mtInternal>::MultiGetHandle SimpleTestGetHandle;
  43 
  44 // Simplest working CRPT implementation for the hash-table.
  45 struct Pointer : public SimpleTestTable::BaseConfig {
  46   static uintx get_hash(const uintptr_t& value, bool* dead_hash) {
  47     return (uintx)value;
  48   }
  49   static const uintptr_t& notfound() {
  50     static uintptr_t notfound = 0;
  51     return notfound;
  52   }




  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 #include "precompiled.hpp"
  25 #include "runtime/mutex.hpp"
  26 #include "runtime/semaphore.hpp"
  27 #include "runtime/thread.hpp"
  28 #include "runtime/vmThread.hpp"
  29 #include "runtime/vm_operations.hpp"
  30 #include "utilities/concurrentHashTable.inline.hpp"
  31 #include "utilities/concurrentHashTableTasks.inline.hpp"
  32 #include "threadHelper.inline.hpp"
  33 #include "unittest.hpp"
  34 
  35 // NOTE: On win32 gtest asserts are not mt-safe.
  36 // Amusingly as long as they do not assert they are mt-safe.
  37 #define SIZE_32 5
  38 
  39 struct Pointer;
  40 
  41 typedef ConcurrentHashTable<uintptr_t, Pointer, mtInternal> SimpleTestTable;
  42 typedef ConcurrentHashTable<uintptr_t, Pointer, mtInternal>::MultiGetHandle SimpleTestGetHandle;
  43 
  44 // Simplest working CRPT implementation for the hash-table.
  45 struct Pointer : public SimpleTestTable::BaseConfig {
  46   static uintx get_hash(const uintptr_t& value, bool* dead_hash) {
  47     return (uintx)value;
  48   }
  49   static const uintptr_t& notfound() {
  50     static uintptr_t notfound = 0;
  51     return notfound;
  52   }


< prev index next >