3475 #endif 3476 3477 return JNI_OK; 3478 } 3479 3480 // Mark the polling page as unreadable 3481 void os::make_polling_page_unreadable(void) { 3482 if (!guard_memory((char*)_polling_page, Bsd::page_size())) { 3483 fatal("Could not disable polling page"); 3484 } 3485 } 3486 3487 // Mark the polling page as readable 3488 void os::make_polling_page_readable(void) { 3489 if (!bsd_mprotect((char *)_polling_page, Bsd::page_size(), PROT_READ)) { 3490 fatal("Could not enable polling page"); 3491 } 3492 } 3493 3494 int os::active_processor_count() { 3495 return _processor_count; 3496 } 3497 3498 void os::set_native_thread_name(const char *name) { 3499 #if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5 3500 // This is only supported in Snow Leopard and beyond 3501 if (name != NULL) { 3502 // Add a "Java: " prefix to the name 3503 char buf[MAXTHREADNAMESIZE]; 3504 snprintf(buf, sizeof(buf), "Java: %s", name); 3505 pthread_setname_np(buf); 3506 } 3507 #endif 3508 } 3509 3510 bool os::distribute_processes(uint length, uint* distribution) { 3511 // Not yet implemented. 3512 return false; 3513 } 3514 | 3475 #endif 3476 3477 return JNI_OK; 3478 } 3479 3480 // Mark the polling page as unreadable 3481 void os::make_polling_page_unreadable(void) { 3482 if (!guard_memory((char*)_polling_page, Bsd::page_size())) { 3483 fatal("Could not disable polling page"); 3484 } 3485 } 3486 3487 // Mark the polling page as readable 3488 void os::make_polling_page_readable(void) { 3489 if (!bsd_mprotect((char *)_polling_page, Bsd::page_size(), PROT_READ)) { 3490 fatal("Could not enable polling page"); 3491 } 3492 } 3493 3494 int os::active_processor_count() { 3495 // User has overridden the number of active processors 3496 if (ActiveProcessorCount > 0) { 3497 log_trace(os)("active_processor_count: " 3498 "active processor count set by user : %d", 3499 ActiveProcessorCount); 3500 return ActiveProcessorCount; 3501 } 3502 3503 return _processor_count; 3504 } 3505 3506 void os::set_native_thread_name(const char *name) { 3507 #if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5 3508 // This is only supported in Snow Leopard and beyond 3509 if (name != NULL) { 3510 // Add a "Java: " prefix to the name 3511 char buf[MAXTHREADNAMESIZE]; 3512 snprintf(buf, sizeof(buf), "Java: %s", name); 3513 pthread_setname_np(buf); 3514 } 3515 #endif 3516 } 3517 3518 bool os::distribute_processes(uint length, uint* distribution) { 3519 // Not yet implemented. 3520 return false; 3521 } 3522 |