diff options
author | Andreas Kling <kling@serenityos.org> | 2021-08-05 20:48:14 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-06 00:37:47 +0200 |
commit | 32a150f2b4f2c100e88e198b78ca2b37cd24a28e (patch) | |
tree | 57aa366ac100d51d7e6afea1f7132b4035cf9857 /Kernel/Thread.cpp | |
parent | af46f2214c5a15435371380aec0e6e015912a56d (diff) | |
download | serenity-32a150f2b4f2c100e88e198b78ca2b37cd24a28e.zip |
Kernel: Make Thread::state_string() return StringView
Diffstat (limited to 'Kernel/Thread.cpp')
-rw-r--r-- | Kernel/Thread.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Kernel/Thread.cpp b/Kernel/Thread.cpp index 8ad12c2661..fadc32d026 100644 --- a/Kernel/Thread.cpp +++ b/Kernel/Thread.cpp @@ -480,25 +480,25 @@ auto Thread::sleep_until(clockid_t clock_id, const Time& deadline) -> BlockResul return Thread::current()->block<Thread::SleepBlocker>({}, Thread::BlockTimeout(true, &deadline, nullptr, clock_id)); } -const char* Thread::state_string() const +StringView Thread::state_string() const { switch (state()) { case Thread::Invalid: - return "Invalid"; + return "Invalid"sv; case Thread::Runnable: - return "Runnable"; + return "Runnable"sv; case Thread::Running: - return "Running"; + return "Running"sv; case Thread::Dying: - return "Dying"; + return "Dying"sv; case Thread::Dead: - return "Dead"; + return "Dead"sv; case Thread::Stopped: - return "Stopped"; + return "Stopped"sv; case Thread::Blocked: { ScopedSpinLock block_lock(m_block_lock); if (m_blocking_lock) - return "Mutex"; + return "Mutex"sv; if (m_blocker) return m_blocker->state_string(); VERIFY_NOT_REACHED(); |