hotspot/src/os/linux/vm/attachListener_linux.cpp
int AttachListener::pd_init() {
{- -------------------------------------------
(1) (変数宣言など)
---------------------------------------- -}
JavaThread* thread = JavaThread::current();
{- -------------------------------------------
(1) ThreadBlockInVM で JavaThread の状態を変更しておく.
---------------------------------------- -}
ThreadBlockInVM tbivm(thread);
{- -------------------------------------------
(1)
---------------------------------------- -}
thread->set_suspend_equivalent();
// cleared by handle_special_suspend_equivalent_condition() or
// java_suspend_self() via check_and_wait_while_suspended()
{- -------------------------------------------
(1) LinuxAttachListener::init() を呼んで
通信用の unix domain socket を開く (ファイル名は .java_pid${PID}).
---------------------------------------- -}
int ret_code = LinuxAttachListener::init();
{- -------------------------------------------
(1) 待っている間に java.lang.Thread.suspend() で suspend 状態にされているかもしれないので,
JavaThread::check_and_wait_while_suspended() でチェックしておく.
もし suspend されていれば, この中で resume されるまで待機する
(See: java.lang.Thread.suspend())
---------------------------------------- -}
// were we externally suspended while we were waiting?
thread->check_and_wait_while_suspended();
{- -------------------------------------------
(1) 結果をリターン
---------------------------------------- -}
return ret_code;
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.