hotspot/src/share/vm/runtime/orderAccess.cpp
changeset 2338 a8660a1b709b
parent 1 489c9b5090e2
child 3261 c7d5aae8d3f7
--- a/hotspot/src/share/vm/runtime/orderAccess.cpp	Tue Mar 24 15:09:52 2009 -0700
+++ b/hotspot/src/share/vm/runtime/orderAccess.cpp	Thu Mar 26 14:31:45 2009 -0700
@@ -26,3 +26,15 @@
 # include "incls/_orderAccess.cpp.incl"
 
 volatile intptr_t OrderAccess::dummy = 0;
+
+void OrderAccess::StubRoutines_fence() {
+  // Use a stub if it exists.  It may not exist during bootstrap so do
+  // nothing in that case but assert if no fence code exists after threads have been created
+  void (*func)() = CAST_TO_FN_PTR(void (*)(), StubRoutines::fence_entry());
+
+  if (func != NULL) {
+    (*func)();
+    return;
+  }
+  assert(Threads::number_of_threads() == 0, "for bootstrap only");
+}