Path: blob/master/src/hotspot/os/aix/misc_aix.cpp
40930 views
/*1* Copyright (c) 2015 SAP SE. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#include "misc_aix.hpp"25#include "runtime/stubRoutines.hpp"26#include "utilities/align.hpp"2728#include <pthread.h>29#include <unistd.h>30#include <errno.h>3132void MiscUtils::init_critsect(MiscUtils::critsect_t* cs) {33const int rc = pthread_mutex_init(cs, NULL);34assert0(rc == 0);35}3637void MiscUtils::free_critsect(MiscUtils::critsect_t* cs) {38const int rc = pthread_mutex_destroy(cs);39assert0(rc == 0);40}4142void MiscUtils::enter_critsect(MiscUtils::critsect_t* cs) {43const int rc = pthread_mutex_lock(cs);44assert0(rc == 0);45}4647void MiscUtils::leave_critsect(MiscUtils::critsect_t* cs) {48const int rc = pthread_mutex_unlock(cs);49assert0(rc == 0);50}515253