Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(472)

Unified Diff: webrtc/base/thread.cc

Issue 2668693005: Use correct calling convention for CreateThread callback on Windows. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/thread.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/thread.cc
diff --git a/webrtc/base/thread.cc b/webrtc/base/thread.cc
index b7d448656dc24ab420261655890cb0fef221da4a..ed0c44674183e5c141a7638953446a89ec07b65a 100644
--- a/webrtc/base/thread.cc
+++ b/webrtc/base/thread.cc
@@ -228,8 +228,7 @@ bool Thread::Start(Runnable* runnable) {
init->thread = this;
init->runnable = runnable;
#if defined(WEBRTC_WIN)
- thread_ = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)PreRun, init, 0,
- &thread_id_);
+ thread_ = CreateThread(NULL, 0, PreRun, init, 0, &thread_id_);
if (thread_) {
running_.Set();
} else {
@@ -308,7 +307,12 @@ void Thread::AssertBlockingIsAllowedOnCurrentThread() {
#endif
}
+// static
+#if defined(WEBRTC_WIN)
+DWORD WINAPI Thread::PreRun(LPVOID pv) {
+#else
void* Thread::PreRun(void* pv) {
+#endif
ThreadInit* init = static_cast<ThreadInit*>(pv);
ThreadManager::Instance()->SetCurrentThread(init->thread);
rtc::SetCurrentThreadName(init->thread->name_.c_str());
@@ -325,7 +329,11 @@ void* Thread::PreRun(void* pv) {
init->thread->Run();
}
delete init;
- return NULL;
+#ifdef WEBRTC_WIN
+ return 0;
+#else
+ return nullptr;
+#endif
}
}
« no previous file with comments | « webrtc/base/thread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698