aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Julien Boeuf <jboeuf@google.com>2015-02-03 16:29:31 -0800
committerGravatar Julien Boeuf <jboeuf@google.com>2015-02-03 16:29:31 -0800
commit57db88f1164314c3680a7a9c60dc36b47c8901f9 (patch)
tree9dd9b590ce431a9ce0348d3ee0b65d843bc6aafb
parent4a0a394758d4f169173c221fe58284fee65970e4 (diff)
Addressing nicolasnoble@ comments.
-rw-r--r--src/core/support/thd_win32.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/support/thd_win32.c b/src/core/support/thd_win32.c
index 9378f91d21..2ee1417048 100644
--- a/src/core/support/thd_win32.c
+++ b/src/core/support/thd_win32.c
@@ -58,16 +58,18 @@ static DWORD WINAPI thread_body(void *v) {
int gpr_thd_new(gpr_thd_id *t, void (*thd_body)(void *arg), void *arg,
const gpr_thd_options *options) {
HANDLE handle;
+ DWORD thread_id;
struct thd_arg *a = gpr_malloc(sizeof(*a));
a->body = thd_body;
a->arg = arg;
*t = 0;
- handle = CreateThread(NULL, 64 * 1024, thread_body, a, 0, NULL);
+ handle = CreateThread(NULL, 64 * 1024, thread_body, a, 0, &thread_id);
if (handle == NULL) {
gpr_free(a);
} else {
CloseHandle(handle); /* threads are "detached" */
}
+ *t = (gpr_thd_id)thread_id;
return handle != NULL;
}