のねのBlog

パソコンの問題や、ソフトウェアの開発で起きた問題など書いていきます。よろしくお願いします^^。

"reacting to signal"

04-02 14:25:27.316      673-680/system_process I/art﹕
 Thread[5,tid=680,WaitingInMainSignalCatcherLoop,Thread*=0xaf60e400,peer=0x12c02080,"Signal Catcher"]:
 reacting to signal 3
    168 int SignalCatcher::WaitForSignal(Thread* self, SignalSet& signals) {
    169   ScopedThreadStateChange tsc(self, kWaitingInMainSignalCatcherLoop);
    170 
    171   // Signals for sigwait() must be blocked but not ignored.  We
    172   // block signals like SIGQUIT for all threads, so the condition
    173   // is met.  When the signal hits, we wake up, without any signal
    174   // handlers being invoked.
    175   int signal_number = signals.Wait();
    176   if (!ShouldHalt()) {
    177     // Let the user know we got the signal, just in case the system's too screwed for us to
    178     // actually do what they want us to do...
    179     LOG(INFO) << *self << ": reacting to signal " << signal_number;
    180 
    181     // If anyone's holding locks (which might prevent us from getting back into state Runnable), say so...
    182     Runtime::Current()->DumpLockHolders(LOG(INFO));
    183   }
    184 
    185   return signal_number;
    186 }
     94 bool SignalCatcher::ShouldHalt() {
     95   MutexLock mu(Thread::Current(), lock_);
     96   return halt_;
     97 }