comparison src/share/vm/runtime/os.hpp @ 18058:54bc75c144b0

Merge
author asaha
date Thu, 29 May 2014 13:14:25 -0700
parents f73af4455d7d
children 52b4284cb496 833b0f92429a
comparison
equal deleted inserted replaced
18055:1fa005fb28f5 18058:54bc75c144b0
39 # include <setjmp.h> 39 # include <setjmp.h>
40 #endif 40 #endif
41 #ifdef TARGET_OS_FAMILY_windows 41 #ifdef TARGET_OS_FAMILY_windows
42 # include "jvm_windows.h" 42 # include "jvm_windows.h"
43 #endif 43 #endif
44 #ifdef TARGET_OS_FAMILY_aix
45 # include "jvm_aix.h"
46 # include <setjmp.h>
47 #endif
44 #ifdef TARGET_OS_FAMILY_bsd 48 #ifdef TARGET_OS_FAMILY_bsd
45 # include "jvm_bsd.h" 49 # include "jvm_bsd.h"
46 # include <setjmp.h> 50 # include <setjmp.h>
51 # ifdef __APPLE__
52 # include <mach/mach_time.h>
53 # endif
47 #endif 54 #endif
48 55
49 class AgentLibrary; 56 class AgentLibrary;
50 57
51 // os defines the interface to operating system; this includes traditional 58 // os defines the interface to operating system; this includes traditional
428 435
429 // thread id on Linux/64bit is 64bit, on Windows and Solaris, it's 32bit 436 // thread id on Linux/64bit is 64bit, on Windows and Solaris, it's 32bit
430 static intx current_thread_id(); 437 static intx current_thread_id();
431 static int current_process_id(); 438 static int current_process_id();
432 static int sleep(Thread* thread, jlong ms, bool interruptable); 439 static int sleep(Thread* thread, jlong ms, bool interruptable);
433 static int naked_sleep(); 440 // Short standalone OS sleep suitable for slow path spin loop.
441 // Ignores Thread.interrupt() (so keep it short).
442 // ms = 0, will sleep for the least amount of time allowed by the OS.
443 static void naked_short_sleep(jlong ms);
434 static void infinite_sleep(); // never returns, use with CAUTION 444 static void infinite_sleep(); // never returns, use with CAUTION
435 static void yield(); // Yields to all threads with same priority 445 static void yield(); // Yields to all threads with same priority
436 enum YieldResult { 446 enum YieldResult {
437 YIELD_SWITCHED = 1, // caller descheduled, other ready threads exist & ran 447 YIELD_SWITCHED = 1, // caller descheduled, other ready threads exist & ran
438 YIELD_NONEREADY = 0, // No other runnable/ready threads. 448 YIELD_NONEREADY = 0, // No other runnable/ready threads.
764 # include "os_posix.hpp" 774 # include "os_posix.hpp"
765 #endif 775 #endif
766 #ifdef TARGET_OS_FAMILY_windows 776 #ifdef TARGET_OS_FAMILY_windows
767 # include "os_windows.hpp" 777 # include "os_windows.hpp"
768 #endif 778 #endif
779 #ifdef TARGET_OS_FAMILY_aix
780 # include "os_aix.hpp"
781 # include "os_posix.hpp"
782 #endif
769 #ifdef TARGET_OS_FAMILY_bsd 783 #ifdef TARGET_OS_FAMILY_bsd
770 # include "os_posix.hpp" 784 # include "os_posix.hpp"
771 # include "os_bsd.hpp" 785 # include "os_bsd.hpp"
772 #endif 786 #endif
773 #ifdef TARGET_OS_ARCH_linux_x86 787 #ifdef TARGET_OS_ARCH_linux_x86
791 #ifdef TARGET_OS_ARCH_linux_arm 805 #ifdef TARGET_OS_ARCH_linux_arm
792 # include "os_linux_arm.hpp" 806 # include "os_linux_arm.hpp"
793 #endif 807 #endif
794 #ifdef TARGET_OS_ARCH_linux_ppc 808 #ifdef TARGET_OS_ARCH_linux_ppc
795 # include "os_linux_ppc.hpp" 809 # include "os_linux_ppc.hpp"
810 #endif
811 #ifdef TARGET_OS_ARCH_aix_ppc
812 # include "os_aix_ppc.hpp"
796 #endif 813 #endif
797 #ifdef TARGET_OS_ARCH_bsd_x86 814 #ifdef TARGET_OS_ARCH_bsd_x86
798 # include "os_bsd_x86.hpp" 815 # include "os_bsd_x86.hpp"
799 #endif 816 #endif
800 #ifdef TARGET_OS_ARCH_bsd_zero 817 #ifdef TARGET_OS_ARCH_bsd_zero