| 62 | __thread KernelStackWatchdog::TLS* KernelStackWatchdog::tls_; |
| 63 | |
| 64 | KernelStackWatchdog::KernelStackWatchdog() |
| 65 | : log_collector_(nullptr), |
| 66 | finish_(1) { |
| 67 | |
| 68 | // During creation of the stack watchdog thread, we need to disable using |
| 69 | // the stack watchdog itself. Otherwise, the 'StartThread' function will |
| 70 | // try to call back into initializing the stack watchdog, and will self-deadlock. |
| 71 | CHECK_OK(Thread::CreateWithFlags( |
| 72 | "kernel-watchdog", "kernel-watcher", |
| 73 | [this]() { this->RunThread(); }, |
| 74 | Thread::NO_STACK_WATCHDOG, |
| 75 | &thread_)); |
| 76 | } |
| 77 | |
| 78 | KernelStackWatchdog::~KernelStackWatchdog() { |
| 79 | finish_.CountDown(); |