0N/A/*
3677N/A * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A * or visit www.oracle.com if you need additional information or have any
1472N/A * questions.
0N/A *
0N/A */
0N/A
1879N/A#ifndef OS_WINDOWS_VM_OSTHREAD_WINDOWS_HPP
1879N/A#define OS_WINDOWS_VM_OSTHREAD_WINDOWS_HPP
1879N/A
3761N/A typedef void* HANDLE;
3761N/A public:
3761N/A typedef unsigned long thread_id_t;
0N/A
0N/A private:
0N/A // Win32-specific thread information
0N/A HANDLE _thread_handle; // Win32 thread handle
0N/A HANDLE _interrupt_event; // Event signalled on thread interrupt
0N/A ThreadState _last_state;
0N/A
0N/A public:
0N/A // The following will only apply in the Win32 implementation, and should only
0N/A // be visible in the concrete class, not this which should be an abstract base class
0N/A HANDLE thread_handle() const { return _thread_handle; }
0N/A void set_thread_handle(HANDLE handle) { _thread_handle = handle; }
0N/A HANDLE interrupt_event() const { return _interrupt_event; }
0N/A void set_interrupt_event(HANDLE interrupt_event) { _interrupt_event = interrupt_event; }
0N/A
0N/A#ifndef PRODUCT
0N/A // Used for debugging, return a unique integer for each thread.
0N/A int thread_identifier() const { return _thread_id; }
0N/A#endif
0N/A#ifdef ASSERT
0N/A // We expect no reposition failures so kill vm if we get one
0N/A //
0N/A bool valid_reposition_failure() {
0N/A return false;
0N/A }
0N/A#endif // ASSERT
0N/A bool is_try_mutex_enter() { return false; }
0N/A
0N/A // This is a temporary fix for the thread states during
0N/A // suspend/resume until we throw away OSThread completely.
0N/A // NEEDS_CLEANUP
0N/A void set_last_state(ThreadState state) { _last_state = state; }
0N/A ThreadState get_last_state() { return _last_state; }
0N/A
0N/A private:
0N/A void pd_initialize();
0N/A void pd_destroy();
1879N/A
1879N/A#endif // OS_WINDOWS_VM_OSTHREAD_WINDOWS_HPP