osThread_bsd.cpp revision 2796
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann/*
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann *
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann * This code is free software; you can redistribute it and/or modify it
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann * under the terms of the GNU General Public License version 2 only, as
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann * published by the Free Software Foundation.
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann *
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann * This code is distributed in the hope that it will be useful, but WITHOUT
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann * version 2 for more details (a copy is included in the LICENSE file that
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann * accompanied this code).
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann *
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann * You should have received a copy of the GNU General Public License version
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann * 2 along with this work; if not, write to the Free Software Foundation,
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann *
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann * or visit www.oracle.com if you need additional information or have any
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann * questions.
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann *
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann */
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann// no precompiled headers
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann#include "runtime/atomic.hpp"
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann#include "runtime/handles.inline.hpp"
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann#include "runtime/mutexLocker.hpp"
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann#include "runtime/os.hpp"
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann#include "runtime/osThread.hpp"
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann#include "runtime/safepoint.hpp"
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann#include "runtime/vmThread.hpp"
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann#ifdef TARGET_ARCH_x86
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann# include "assembler_x86.inline.hpp"
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann#endif
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann#ifdef TARGET_ARCH_sparc
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann# include "assembler_sparc.inline.hpp"
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann#endif
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann#ifdef TARGET_ARCH_zero
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann# include "assembler_zero.inline.hpp"
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann#endif
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann#ifdef TARGET_ARCH_arm
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann# include "assembler_arm.inline.hpp"
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann#endif
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann#ifdef TARGET_ARCH_ppc
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann# include "assembler_ppc.inline.hpp"
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann#endif
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmannvoid OSThread::pd_initialize() {
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann assert(this != NULL, "check");
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann _thread_id = NULL;
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann _pthread_id = NULL;
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann _siginfo = NULL;
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann _ucontext = NULL;
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann _expanding_stack = 0;
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann _alt_sig_stack = NULL;
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann sigemptyset(&_caller_sigmask);
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann _startThread_lock = new Monitor(Mutex::event, "startThread_lock", true);
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann assert(_startThread_lock !=NULL, "check");
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann}
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmannvoid OSThread::pd_destroy() {
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann delete _startThread_lock;
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann}
2450a4210dee64b064499a3a1154129bdfc74981Daniel Hausmann