Skip to content
Snippets Groups Projects
Commit 275b3ac0 authored by jtattermusch's avatar jtattermusch Committed by Michael Lumish
Browse files

Getting rid of MS C++ warning when compiling GPR on Windows.

1>c:\users\jtattermusch\grpc_tar\src\core\support\sync_win32.c(97): warning C4244: 'function' : conversion from 'gpr_int64' to 'DWORD', possible loss of data
	Change on 2014/12/09 by jtattermusch <jtattermusch@google.com>
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=81724253
parent 1ef8175b
No related branches found
No related tags found
No related merge requests found
......@@ -83,6 +83,7 @@ void gpr_cv_destroy(gpr_cv *cv) {
int gpr_cv_wait(gpr_cv *cv, gpr_mu *mu, gpr_timespec abs_deadline) {
int timeout = 0;
DWORD timeout_max_ms;
if (gpr_time_cmp(abs_deadline, gpr_inf_future) == 0) {
SleepConditionVariableCS(cv, &mu->cs, INFINITE);
} else {
......@@ -93,9 +94,9 @@ int gpr_cv_wait(gpr_cv *cv, gpr_mu *mu, gpr_timespec abs_deadline) {
if (now_ms >= deadline_ms) {
timeout = 1;
} else {
timeout =
(SleepConditionVariableCS(cv, &mu->cs, deadline_ms - now_ms) == 0 &&
GetLastError() == ERROR_TIMEOUT);
timeout_max_ms = (DWORD)min(deadline_ms - now_ms, INFINITE - 1);
timeout = (SleepConditionVariableCS(cv, &mu->cs, timeout_max_ms) == 0 &&
GetLastError() == ERROR_TIMEOUT);
}
}
return timeout;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment