4789 Linux::_pthread_setname_np =
4790 (int(*)(pthread_t, const char*))dlsym(RTLD_DEFAULT, "pthread_setname_np");
4791
4792 os::Posix::init();
4793 }
4794
4795 // To install functions for atexit system call
4796 extern "C" {
4797 static void perfMemory_exit_helper() {
4798 perfMemory_exit();
4799 }
4800 }
4801
4802 // this is called _after_ the global arguments have been parsed
4803 jint os::init_2(void) {
4804
4805 os::Posix::init_2();
4806
4807 Linux::fast_thread_clock_init();
4808
4809 // Allocate a single page and mark it as readable for safepoint polling
4810 address polling_page = (address) ::mmap(NULL, Linux::page_size(), PROT_READ, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
4811 guarantee(polling_page != MAP_FAILED, "os::init_2: failed to allocate polling page");
4812
4813 os::set_polling_page(polling_page);
4814 log_info(os)("SafePoint Polling address: " INTPTR_FORMAT, p2i(polling_page));
4815
4816 if (!UseMembar) {
4817 address mem_serialize_page = (address) ::mmap(NULL, Linux::page_size(), PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
4818 guarantee(mem_serialize_page != MAP_FAILED, "mmap Failed for memory serialize page");
4819 os::set_memory_serialize_page(mem_serialize_page);
4820 log_info(os)("Memory Serialize Page address: " INTPTR_FORMAT, p2i(mem_serialize_page));
4821 }
4822
4823 // initialize suspend/resume support - must do this before signal_sets_init()
4824 if (SR_initialize() != 0) {
4825 perror("SR_initialize failed");
4826 return JNI_ERR;
4827 }
4828
4829 Linux::signal_sets_init();
4830 Linux::install_signal_handlers();
4831
4832 // Check and sets minimum stack sizes against command line options
4833 if (Posix::set_minimum_stack_sizes() == JNI_ERR) {
4834 return JNI_ERR;
4835 }
4836 Linux::capture_initial_stack(JavaThread::stack_size_at_create());
4837
4838 #if defined(IA32)
4839 workaround_expand_exec_shield_cs_limit();
4840 #endif
4841
4842 Linux::libpthread_init();
|
4789 Linux::_pthread_setname_np =
4790 (int(*)(pthread_t, const char*))dlsym(RTLD_DEFAULT, "pthread_setname_np");
4791
4792 os::Posix::init();
4793 }
4794
4795 // To install functions for atexit system call
4796 extern "C" {
4797 static void perfMemory_exit_helper() {
4798 perfMemory_exit();
4799 }
4800 }
4801
4802 // this is called _after_ the global arguments have been parsed
4803 jint os::init_2(void) {
4804
4805 os::Posix::init_2();
4806
4807 Linux::fast_thread_clock_init();
4808
4809 // initialize suspend/resume support - must do this before signal_sets_init()
4810 if (SR_initialize() != 0) {
4811 perror("SR_initialize failed");
4812 return JNI_ERR;
4813 }
4814
4815 Linux::signal_sets_init();
4816 Linux::install_signal_handlers();
4817
4818 // Check and sets minimum stack sizes against command line options
4819 if (Posix::set_minimum_stack_sizes() == JNI_ERR) {
4820 return JNI_ERR;
4821 }
4822 Linux::capture_initial_stack(JavaThread::stack_size_at_create());
4823
4824 #if defined(IA32)
4825 workaround_expand_exec_shield_cs_limit();
4826 #endif
4827
4828 Linux::libpthread_init();
|