mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:07:35 +00:00
Kernel: Remove unnecessary StringBuilder from sys$create_thread()
A series of refactors changed Threads to always have a name, and to store their name as a KString. Before the refactors a StringBuilder was used to format the default thread name for a non-main thread, but it is since unused. Remove it and the AK/String related header includes from the thread syscall implementation file.
This commit is contained in:
parent
cca4268ff8
commit
194456efdc
1 changed files with 2 additions and 7 deletions
|
@ -5,8 +5,6 @@
|
|||
*/
|
||||
|
||||
#include <AK/Checked.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <Kernel/Memory/MemoryManager.h>
|
||||
#include <Kernel/PerformanceManager.h>
|
||||
#include <Kernel/Process.h>
|
||||
|
@ -43,13 +41,10 @@ ErrorOr<FlatPtr> Process::sys$create_thread(void* (*entry)(void*), Userspace<con
|
|||
|
||||
auto thread = TRY(Thread::try_create(*this));
|
||||
|
||||
// FIXME: Don't make a temporary String here
|
||||
auto new_thread_name = TRY(KString::try_create(String::formatted("{} [{}]", m_name, thread->tid().value())));
|
||||
|
||||
// We know this thread is not the main_thread,
|
||||
// So give it a unique name until the user calls $set_thread_name on it
|
||||
// length + 4 to give space for our extra junk at the end
|
||||
StringBuilder builder(m_name->length() + 4);
|
||||
// FIXME: Don't make a temporary String here
|
||||
auto new_thread_name = TRY(KString::try_create(String::formatted("{} [{}]", m_name, thread->tid().value())));
|
||||
thread->set_name(move(new_thread_name));
|
||||
|
||||
if (!is_thread_joinable)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue