426 address page = (address) _mem_serialize_page;
427 return addr >= page && addr < (page + os::vm_page_size());
428 }
429
430 static void block_on_serialize_page_trap();
431
432 // threads
433
434 enum ThreadType {
435 vm_thread,
436 cgc_thread, // Concurrent GC thread
437 pgc_thread, // Parallel GC thread
438 java_thread,
439 compiler_thread,
440 watcher_thread,
441 os_thread
442 };
443
444 static bool create_thread(Thread* thread,
445 ThreadType thr_type,
446 size_t stack_size = 0);
447 static bool create_main_thread(JavaThread* thread);
448 static bool create_attached_thread(JavaThread* thread);
449 static void pd_start_thread(Thread* thread);
450 static void start_thread(Thread* thread);
451
452 static void initialize_thread(Thread* thr);
453 static void free_thread(OSThread* osthread);
454
455 // thread id on Linux/64bit is 64bit, on Windows and Solaris, it's 32bit
456 static intx current_thread_id();
457 static int current_process_id();
458 static int sleep(Thread* thread, jlong ms, bool interruptable);
459 // Short standalone OS sleep suitable for slow path spin loop.
460 // Ignores Thread.interrupt() (so keep it short).
461 // ms = 0, will sleep for the least amount of time allowed by the OS.
462 static void naked_short_sleep(jlong ms);
463 static void infinite_sleep(); // never returns, use with CAUTION
464 static void naked_yield () ;
465 static OSReturn set_priority(Thread* thread, ThreadPriority priority);
466 static OSReturn get_priority(const Thread* const thread, ThreadPriority& priority);
|
426 address page = (address) _mem_serialize_page;
427 return addr >= page && addr < (page + os::vm_page_size());
428 }
429
430 static void block_on_serialize_page_trap();
431
432 // threads
433
434 enum ThreadType {
435 vm_thread,
436 cgc_thread, // Concurrent GC thread
437 pgc_thread, // Parallel GC thread
438 java_thread,
439 compiler_thread,
440 watcher_thread,
441 os_thread
442 };
443
444 static bool create_thread(Thread* thread,
445 ThreadType thr_type,
446 size_t req_stack_size = 0);
447 static bool create_main_thread(JavaThread* thread);
448 static bool create_attached_thread(JavaThread* thread);
449 static void pd_start_thread(Thread* thread);
450 static void start_thread(Thread* thread);
451
452 static void initialize_thread(Thread* thr);
453 static void free_thread(OSThread* osthread);
454
455 // thread id on Linux/64bit is 64bit, on Windows and Solaris, it's 32bit
456 static intx current_thread_id();
457 static int current_process_id();
458 static int sleep(Thread* thread, jlong ms, bool interruptable);
459 // Short standalone OS sleep suitable for slow path spin loop.
460 // Ignores Thread.interrupt() (so keep it short).
461 // ms = 0, will sleep for the least amount of time allowed by the OS.
462 static void naked_short_sleep(jlong ms);
463 static void infinite_sleep(); // never returns, use with CAUTION
464 static void naked_yield () ;
465 static OSReturn set_priority(Thread* thread, ThreadPriority priority);
466 static OSReturn get_priority(const Thread* const thread, ThreadPriority& priority);
|