Path: blob/master/src/hotspot/os/windows/osThread_windows.hpp
40930 views
/*1* Copyright (c) 1997, 2019, Oracle and/or its affiliates. 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#ifndef OS_WINDOWS_OSTHREAD_WINDOWS_HPP25#define OS_WINDOWS_OSTHREAD_WINDOWS_HPP2627typedef void* HANDLE;28public:29typedef unsigned long thread_id_t;3031private:32// Win32-specific thread information33HANDLE _thread_handle; // Win32 thread handle34HANDLE _interrupt_event; // Event signalled on thread interrupt for use by35// Process.waitFor().36ThreadState _last_state;3738public:39// The following will only apply in the Win32 implementation, and should only40// be visible in the concrete class, not this which should be an abstract base class41HANDLE thread_handle() const { return _thread_handle; }42void set_thread_handle(HANDLE handle) { _thread_handle = handle; }43HANDLE interrupt_event() const { return _interrupt_event; }44void set_interrupt_event(HANDLE interrupt_event) { _interrupt_event = interrupt_event; }45// This is specialized on Windows to interact with the _interrupt_event.46void set_interrupted(bool z);4748#ifndef PRODUCT49// Used for debugging, return a unique integer for each thread.50int thread_identifier() const { return _thread_id; }51#endif52#ifdef ASSERT53// We expect no reposition failures so kill vm if we get one54//55bool valid_reposition_failure() {56return false;57}58#endif // ASSERT5960// This is a temporary fix for the thread states during61// suspend/resume until we throw away OSThread completely.62// NEEDS_CLEANUP63void set_last_state(ThreadState state) { _last_state = state; }64ThreadState get_last_state() { return _last_state; }6566private:67void pd_initialize();68void pd_destroy();6970#endif // OS_WINDOWS_OSTHREAD_WINDOWS_HPP717273