Fallback to display thread id of no name was assigned, OpenVulkano::Utils::GetThreadId()
This commit is contained in:
@@ -43,14 +43,22 @@ namespace OpenVulkano
|
||||
return str;
|
||||
#else
|
||||
// NOTE(vb): Accoring to linux man page size of this array must be _at least_ 16 bytes...
|
||||
// But I don't know whether is it applicable to have the buffer of bigger size
|
||||
char threadName[16];
|
||||
char threadName[64];
|
||||
pthread_getname_np(pthread_self(), threadName, sizeof(threadName));
|
||||
std::string str = threadName;
|
||||
return str;
|
||||
#endif
|
||||
}
|
||||
|
||||
uint64_t Utils::GetThreadId()
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
return (uint64_t)::GetThreadId(::GetCurrentThread());
|
||||
#else
|
||||
return (uint64_t)pthread_self();
|
||||
#endif
|
||||
}
|
||||
|
||||
Array<char> Utils::ReadFile(const std::string& filePath, bool emptyOnMissing)
|
||||
{
|
||||
std::ifstream file(filePath, std::ios::ate | std::ios::binary);
|
||||
|
||||
Reference in New Issue
Block a user