419 if (UseMembar) return false;
420 // Previously this function calculated the exact address of this
421 // thread's serialize page, and checked if the faulting address
422 // was equal. However, some platforms mask off faulting addresses
423 // to the page size, so now we just check that the address is
424 // within the page. This makes the thread argument unnecessary,
425 // but we retain the NULL check to preserve existing behavior.
426 if (thread == NULL) return false;
427 address page = (address) _mem_serialize_page;
428 return addr >= page && addr < (page + os::vm_page_size());
429 }
430
431 static void block_on_serialize_page_trap();
432
433 // threads
434
435 enum ThreadType {
436 vm_thread,
437 cgc_thread, // Concurrent GC thread
438 pgc_thread, // Parallel GC thread
439 java_thread,
440 compiler_thread,
441 watcher_thread,
442 os_thread
443 };
444
445 static bool create_thread(Thread* thread,
446 ThreadType thr_type,
447 size_t req_stack_size = 0);
448 static bool create_main_thread(JavaThread* thread);
449 static bool create_attached_thread(JavaThread* thread);
450 static void pd_start_thread(Thread* thread);
451 static void start_thread(Thread* thread);
452
453 static void initialize_thread(Thread* thr);
454 static void free_thread(OSThread* osthread);
455
456 // thread id on Linux/64bit is 64bit, on Windows and Solaris, it's 32bit
457 static intx current_thread_id();
458 static int current_process_id();
459 static int sleep(Thread* thread, jlong ms, bool interruptable);
|
419 if (UseMembar) return false;
420 // Previously this function calculated the exact address of this
421 // thread's serialize page, and checked if the faulting address
422 // was equal. However, some platforms mask off faulting addresses
423 // to the page size, so now we just check that the address is
424 // within the page. This makes the thread argument unnecessary,
425 // but we retain the NULL check to preserve existing behavior.
426 if (thread == NULL) return false;
427 address page = (address) _mem_serialize_page;
428 return addr >= page && addr < (page + os::vm_page_size());
429 }
430
431 static void block_on_serialize_page_trap();
432
433 // threads
434
435 enum ThreadType {
436 vm_thread,
437 cgc_thread, // Concurrent GC thread
438 pgc_thread, // Parallel GC thread
439 java_thread, // Java, CocdeCacheSweeper, JVMTIAgent and Service threads.
440 compiler_thread,
441 watcher_thread,
442 os_thread
443 };
444
445 static bool create_thread(Thread* thread,
446 ThreadType thr_type,
447 size_t req_stack_size = 0);
448 static bool create_main_thread(JavaThread* thread);
449 static bool create_attached_thread(JavaThread* thread);
450 static void pd_start_thread(Thread* thread);
451 static void start_thread(Thread* thread);
452
453 static void initialize_thread(Thread* thr);
454 static void free_thread(OSThread* osthread);
455
456 // thread id on Linux/64bit is 64bit, on Windows and Solaris, it's 32bit
457 static intx current_thread_id();
458 static int current_process_id();
459 static int sleep(Thread* thread, jlong ms, bool interruptable);
|