429 return addr >= page && addr < (page + os::vm_page_size()); 430 } 431 432 static void block_on_serialize_page_trap(); 433 434 // threads 435 436 enum ThreadType { 437 vm_thread, 438 cgc_thread, // Concurrent GC thread 439 pgc_thread, // Parallel GC thread 440 java_thread, // Java, CodeCacheSweeper, JVMTIAgent and Service threads. 441 compiler_thread, 442 watcher_thread, 443 os_thread 444 }; 445 446 static bool create_thread(Thread* thread, 447 ThreadType thr_type, 448 size_t req_stack_size = 0); 449 static bool create_main_thread(JavaThread* thread); 450 static bool create_attached_thread(JavaThread* thread); 451 static void pd_start_thread(Thread* thread); 452 static void start_thread(Thread* thread); 453 454 static void initialize_thread(Thread* thr); 455 static void free_thread(OSThread* osthread); 456 457 // thread id on Linux/64bit is 64bit, on Windows and Solaris, it's 32bit 458 static intx current_thread_id(); 459 static int current_process_id(); 460 static int sleep(Thread* thread, jlong ms, bool interruptable); 461 // Short standalone OS sleep suitable for slow path spin loop. 462 // Ignores Thread.interrupt() (so keep it short). 463 // ms = 0, will sleep for the least amount of time allowed by the OS. 464 static void naked_short_sleep(jlong ms); 465 static void infinite_sleep(); // never returns, use with CAUTION 466 static void naked_yield () ; 467 static OSReturn set_priority(Thread* thread, ThreadPriority priority); 468 static OSReturn get_priority(const Thread* const thread, ThreadPriority& priority); 469 | 429 return addr >= page && addr < (page + os::vm_page_size()); 430 } 431 432 static void block_on_serialize_page_trap(); 433 434 // threads 435 436 enum ThreadType { 437 vm_thread, 438 cgc_thread, // Concurrent GC thread 439 pgc_thread, // Parallel GC thread 440 java_thread, // Java, CodeCacheSweeper, JVMTIAgent and Service threads. 441 compiler_thread, 442 watcher_thread, 443 os_thread 444 }; 445 446 static bool create_thread(Thread* thread, 447 ThreadType thr_type, 448 size_t req_stack_size = 0); 449 // The "main thread", also known as "starting thread", is the thread 450 // that loads/creates the JVM via JNI_CreateJavaVM 451 static bool create_main_thread(JavaThread* thread); 452 // The primordial thread is the initial process thread. The java 453 // launcher nevers uses the primordial thread as the main thread, but 454 // applications that host the JVM directly may do so. Some platforms 455 // have to special-case handling of the primordial thread if it attaches 456 // to the VM. 457 static bool is_primordial_thread(void); 458 static bool create_attached_thread(JavaThread* thread); 459 static void pd_start_thread(Thread* thread); 460 static void start_thread(Thread* thread); 461 462 static void initialize_thread(Thread* thr); 463 static void free_thread(OSThread* osthread); 464 465 // thread id on Linux/64bit is 64bit, on Windows and Solaris, it's 32bit 466 static intx current_thread_id(); 467 static int current_process_id(); 468 static int sleep(Thread* thread, jlong ms, bool interruptable); 469 // Short standalone OS sleep suitable for slow path spin loop. 470 // Ignores Thread.interrupt() (so keep it short). 471 // ms = 0, will sleep for the least amount of time allowed by the OS. 472 static void naked_short_sleep(jlong ms); 473 static void infinite_sleep(); // never returns, use with CAUTION 474 static void naked_yield () ; 475 static OSReturn set_priority(Thread* thread, ThreadPriority priority); 476 static OSReturn get_priority(const Thread* const thread, ThreadPriority& priority); 477 |