summaryrefslogtreecommitdiffstats
path: root/source/OSSupport/IsThread.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-11-13 22:54:01 +0100
committermadmaxoft <github@xoft.cz>2013-11-13 22:54:01 +0100
commit99da44095aa6fa503bc54f39cfb447be7edf88a1 (patch)
tree651ae4deaaa0641550cfbfa437628a6f4d29629a /source/OSSupport/IsThread.h
parentMerge remote-tracking branch 'origin/WolfUpdate' (diff)
downloadcuberite-99da44095aa6fa503bc54f39cfb447be7edf88a1.tar
cuberite-99da44095aa6fa503bc54f39cfb447be7edf88a1.tar.gz
cuberite-99da44095aa6fa503bc54f39cfb447be7edf88a1.tar.bz2
cuberite-99da44095aa6fa503bc54f39cfb447be7edf88a1.tar.lz
cuberite-99da44095aa6fa503bc54f39cfb447be7edf88a1.tar.xz
cuberite-99da44095aa6fa503bc54f39cfb447be7edf88a1.tar.zst
cuberite-99da44095aa6fa503bc54f39cfb447be7edf88a1.zip
Diffstat (limited to '')
-rw-r--r--source/OSSupport/IsThread.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/OSSupport/IsThread.h b/source/OSSupport/IsThread.h
index 2ea8bf6f9..b8784ea33 100644
--- a/source/OSSupport/IsThread.h
+++ b/source/OSSupport/IsThread.h
@@ -51,15 +51,28 @@ public:
protected:
AString m_ThreadName;
+ // Value used for "no handle":
+ #ifdef _WIN32
+ #define NULL_HANDLE NULL
+ #else
+ #define NULL_HANDLE 0
+ #endif
+
#ifdef _WIN32
HANDLE m_Handle;
static DWORD_PTR __stdcall thrExecute(LPVOID a_Param)
{
+ // Create a window so that the thread can be identified by 3rd party tools:
HWND IdentificationWnd = CreateWindow("STATIC", ((cIsThread *)a_Param)->m_ThreadName.c_str(), 0, 0, 0, 0, WS_OVERLAPPED, NULL, NULL, NULL, NULL);
+
+ // Run the thread:
((cIsThread *)a_Param)->Execute();
+
+ // Destroy the identification window:
DestroyWindow(IdentificationWnd);
+
return 0;
}