orderAccess.cpp revision 1631
1051N/A/*
1051N/A * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
1051N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1051N/A *
1051N/A * This code is free software; you can redistribute it and/or modify it
1051N/A * under the terms of the GNU General Public License version 2 only, as
1051N/A * published by the Free Software Foundation.
1051N/A *
1051N/A * This code is distributed in the hope that it will be useful, but WITHOUT
1051N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1051N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1051N/A * version 2 for more details (a copy is included in the LICENSE file that
1051N/A * accompanied this code).
1051N/A *
1051N/A * You should have received a copy of the GNU General Public License version
1051N/A * 2 along with this work; if not, write to the Free Software Foundation,
1051N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1051N/A *
1051N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1051N/A * or visit www.oracle.com if you need additional information or have any
1051N/A * questions.
1051N/A *
1051N/A */
1051N/A
1051N/A# include "incls/_precompiled.incl"
1051N/A# include "incls/_orderAccess.cpp.incl"
1051N/A
1051N/Avoid OrderAccess::StubRoutines_fence() {
1051N/A // Use a stub if it exists. It may not exist during bootstrap so do
1051N/A // nothing in that case but assert if no fence code exists after threads have been created
1051N/A void (*func)() = CAST_TO_FN_PTR(void (*)(), StubRoutines::fence_entry());
1051N/A
1051N/A if (func != NULL) {
1051N/A (*func)();
1175N/A return;
1111N/A }
1051N/A assert(Threads::number_of_threads() == 0, "for bootstrap only");
1051N/A}
1051N/A