orderAccess.cpp revision 1631:a6bff45449bc
1336809Sdim/*
2336809Sdim * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
3353358Sdim * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4353358Sdim *
5353358Sdim * This code is free software; you can redistribute it and/or modify it
6336809Sdim * under the terms of the GNU General Public License version 2 only, as
7336809Sdim * published by the Free Software Foundation.
8336809Sdim *
9336809Sdim * This code is distributed in the hope that it will be useful, but WITHOUT
10336809Sdim * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11336809Sdim * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12336809Sdim * version 2 for more details (a copy is included in the LICENSE file that
13336809Sdim * accompanied this code).
14336809Sdim *
15336809Sdim * You should have received a copy of the GNU General Public License version
16336809Sdim * 2 along with this work; if not, write to the Free Software Foundation,
17336809Sdim * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18336809Sdim *
19336809Sdim * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20336809Sdim * or visit www.oracle.com if you need additional information or have any
21336809Sdim * questions.
22336809Sdim *
23336809Sdim */
24336809Sdim
25336809Sdim# include "incls/_precompiled.incl"
26336809Sdim# include "incls/_orderAccess.cpp.incl"
27336809Sdim
28336809Sdimvoid OrderAccess::StubRoutines_fence() {
29336809Sdim  // Use a stub if it exists.  It may not exist during bootstrap so do
30336809Sdim  // nothing in that case but assert if no fence code exists after threads have been created
31336809Sdim  void (*func)() = CAST_TO_FN_PTR(void (*)(), StubRoutines::fence_entry());
32336809Sdim
33336809Sdim  if (func != NULL) {
34336809Sdim    (*func)();
35336809Sdim    return;
36336809Sdim  }
37336809Sdim  assert(Threads::number_of_threads() == 0, "for bootstrap only");
38336809Sdim}
39336809Sdim