changeset 33358:c9c9f015619b

Don't use CreateThread() unconditionally. CreateThread() is only needed for Cygwin, otherwise _beginthreadex() is preferable. This revises r33390.
author ib
date Sun, 08 May 2011 13:47:19 +0000
parents 5a5c875e7392
children b1e64a3d6dd3
files gui/win32/interface.c
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gui/win32/interface.c	Sun May 08 13:34:32 2011 +0000
+++ b/gui/win32/interface.c	Sun May 08 13:47:19 2011 +0000
@@ -22,6 +22,13 @@
  */
 
 #include <windows.h>
+
+#if defined(__CYGWIN__)
+#define _beginthreadex CreateThread
+#else
+#include <process.h>
+#endif
+
 #include "path.h"
 #include "gui/interface.h"
 #include "m_option.h"
@@ -493,7 +500,7 @@
     /* Create The gui thread */
     if (!mygui)
     {
-        hThread = CreateThread(NULL, 0, GuiThread, NULL, 0, &threadId);
+        hThread = _beginthreadex(NULL, 0, GuiThread, NULL, 0, &threadId);
         mp_msg(MSGT_GPLAYER, MSGL_V, "[GUI] Creating GUI Thread 0x%04x\n", threadId);
     }