Add prioritizedworkqueue, thread stuff, ui tweaks, small optimizations in file util

This commit is contained in:
Henrik Rydgard committed 2013-04-13 21:22:03 +02:00
1 parent bff1115f0c
commit 25711066df
18 files changed
+587 -40

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
#ifdef _WIN32
#include <windows.h>
#endif
#include "thread/threadutil.h"
void setCurrentThreadName(const char* szThreadName)
{
#ifdef _WIN32
static const DWORD MS_VC_EXCEPTION = 0x406D1388;
#pragma pack(push,8)
struct THREADNAME_INFO
{
DWORD dwType; // must be 0x1000
LPCSTR szName; // pointer to name (in user addr space)
DWORD dwThreadID; // thread ID (-1=caller thread)
DWORD dwFlags; // reserved for future use, must be zero
} info;
#pragma pack(pop)
info.dwType = 0x1000;
info.szName = szThreadName;
info.dwThreadID = -1; //dwThreadID;
info.dwFlags = 0;
__try
{
RaiseException(MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(ULONG_PTR), (ULONG_PTR*)&info);
}
__except(EXCEPTION_CONTINUE_EXECUTION)
{}
#else
// Do nothing
#endif
}