mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:38:11 +00:00
LibThreading: Add Thread formatter
Printing a thread for debugging is used quite often.
This commit is contained in:
parent
9e40d4ccd6
commit
fe004d3389
1 changed files with 8 additions and 0 deletions
|
@ -63,3 +63,11 @@ Result<T, ThreadError> Thread::join()
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
template<>
|
||||
struct AK::Formatter<Threading::Thread> : AK::Formatter<FormatString> {
|
||||
ErrorOr<void> format(FormatBuilder& builder, Threading::Thread const& thread)
|
||||
{
|
||||
return Formatter<FormatString>::format(builder, "Thread \"{}\"({})"sv, thread.thread_name(), thread.tid());
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue