proper thread names

This commit is contained in:
Ryan Fleury
2024-02-22 16:20:27 -08:00
parent 74d051f383
commit 5813cb2af8
16 changed files with 184 additions and 102 deletions
+19
View File
@@ -1,2 +1,21 @@
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
internal void
thread_name(String8 string)
{
ProfThreadName("%.*s", str8_varg(string));
os_set_thread_name(string);
}
internal void
thread_namef(char *fmt, ...)
{
Temp scratch = scratch_begin(0, 0);
va_list args;
va_start(args, fmt);
String8 string = push_str8fv(scratch.arena, fmt, args);
thread_name(string);
va_end(args);
scratch_end(scratch);
}