aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2018-02-21 07:26:00 -0800
committerGravatar Vijay Pai <vpai@google.com>2018-02-21 07:26:00 -0800
commit57c52eebce27bd104ae130e72c3833f361b11919 (patch)
tree9cc85ed430dae2193668d7f021f82def7fd071d7 /src
parent4a0cd7004266f28c42c098e35d3cebadb68091fa (diff)
MinGW requires lambdas to set their calling method if needed
Diffstat (limited to 'src')
-rw-r--r--src/core/lib/gprpp/thd_windows.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/lib/gprpp/thd_windows.cc b/src/core/lib/gprpp/thd_windows.cc
index ce7d3298a6..6e2095fe03 100644
--- a/src/core/lib/gprpp/thd_windows.cc
+++ b/src/core/lib/gprpp/thd_windows.cc
@@ -31,8 +31,10 @@
#if defined(_MSC_VER)
#define thread_local __declspec(thread)
+#define WIN_LAMBDA
#elif defined(__GNUC__)
#define thread_local __thread
+#define WIN_LAMBDA WINAPI
#else
#error "Unknown compiler - please file a bug report"
#endif
@@ -81,7 +83,7 @@ Thread::Thread(const char* thd_name, void (*thd_body)(void* arg), void* arg,
alive_ = false;
} else {
handle = CreateThread(nullptr, 64 * 1024,
- [](void* v) -> DWORD {
+ [](void* v) WIN_LAMBDA -> DWORD {
g_thd_info = static_cast<thd_info*>(v);
gpr_mu_lock(&g_thd_info->thread->mu_);
if (!g_thd_info->thread->started_) {