summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/JavaScriptCore/wtf/ThreadingWin.cpp
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2009-07-29 07:26:08 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2009-07-29 07:26:08 (GMT)
commita7cc30b30df53d6a70208c25f6c12a9f229b3ea6 (patch)
tree7764192081a6f36113bc7c2f32419fa36ed7013b /src/3rdparty/webkit/JavaScriptCore/wtf/ThreadingWin.cpp
parentfb7d86cf23227302d48db279ec589221d11a1f6a (diff)
parent3b00ee50810206a20a5bb1b06e1dfaf593aae7ed (diff)
downloadQt-a7cc30b30df53d6a70208c25f6c12a9f229b3ea6.zip
Qt-a7cc30b30df53d6a70208c25f6c12a9f229b3ea6.tar.gz
Qt-a7cc30b30df53d6a70208c25f6c12a9f229b3ea6.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/wtf/ThreadingWin.cpp')
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/wtf/ThreadingWin.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/ThreadingWin.cpp b/src/3rdparty/webkit/JavaScriptCore/wtf/ThreadingWin.cpp
index ea18656..cccbda1 100644
--- a/src/3rdparty/webkit/JavaScriptCore/wtf/ThreadingWin.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/wtf/ThreadingWin.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2009 Torch Mobile, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -89,7 +90,14 @@
#if !USE(PTHREADS) && PLATFORM(WIN_OS)
#include "ThreadSpecific.h"
#endif
+#if !PLATFORM(WINCE)
#include <process.h>
+#endif
+#if HAVE(ERRNO_H)
+#include <errno.h>
+#else
+#define NO_ERRNO
+#endif
#include <windows.h>
#include <wtf/CurrentTime.h>
#include <wtf/HashMap.h>
@@ -210,9 +218,21 @@ ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, con
unsigned threadIdentifier = 0;
ThreadIdentifier threadID = 0;
ThreadFunctionInvocation* invocation = new ThreadFunctionInvocation(entryPoint, data);
+#if PLATFORM(WINCE)
+ // This is safe on WINCE, since CRT is in the core and innately multithreaded.
+ // On desktop Windows, need to use _beginthreadex (not available on WinCE) if using any CRT functions
+ HANDLE threadHandle = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)wtfThreadEntryPoint, invocation, 0, (LPDWORD)&threadIdentifier);
+#else
HANDLE threadHandle = reinterpret_cast<HANDLE>(_beginthreadex(0, 0, wtfThreadEntryPoint, invocation, 0, &threadIdentifier));
+#endif
if (!threadHandle) {
+#if PLATFORM(WINCE)
+ LOG_ERROR("Failed to create thread at entry point %p with data %p: %ld", entryPoint, data, ::GetLastError());
+#elif defined(NO_ERRNO)
+ LOG_ERROR("Failed to create thread at entry point %p with data %p.", entryPoint, data);
+#else
LOG_ERROR("Failed to create thread at entry point %p with data %p: %ld", entryPoint, data, errno);
+#endif
return 0;
}