mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 09:49:15 +03:00
LibThreading: Add Thread formatter
Printing a thread for debugging is used quite often.
This commit is contained in:
parent
9e40d4ccd6
commit
fe004d3389
Notes:
sideshowbarker
2024-07-17 03:24:28 +09:00
Author: https://github.com/kleinesfilmroellchen Commit: https://github.com/SerenityOS/serenity/commit/fe004d3389 Pull-request: https://github.com/SerenityOS/serenity/pull/16011 Reviewed-by: https://github.com/ADKaster ✅
@ -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…
Reference in New Issue
Block a user