diff options
author | nnoble <nnoble@google.com> | 2014-12-11 11:07:51 -0800 |
---|---|---|
committer | Jan Tattermusch <jtattermusch@google.com> | 2014-12-11 15:11:44 -0800 |
commit | 4eec017e8e3ba501d1b90f2131a1ff4f3df77de0 (patch) | |
tree | fce460a024aad9d2e83598eb996152698bc5c46d /src | |
parent | 430c4996e80b60c7a0dac760e224fb9ea0128690 (diff) |
Fixing sync_win32.c
Calling SleepConditionVariableCS will ultimately unlock then relock the critical section, so we have to reflect that in the anti-recursion boolean.
Change on 2014/12/11 by nnoble <nnoble@google.com>
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=81893180
Diffstat (limited to 'src')
-rw-r--r-- | src/core/support/sync_win32.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/support/sync_win32.c b/src/core/support/sync_win32.c index b2e922565f..8df26bccb9 100644 --- a/src/core/support/sync_win32.c +++ b/src/core/support/sync_win32.c @@ -84,6 +84,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; + mu->locked = 0; if (gpr_time_cmp(abs_deadline, gpr_inf_future) == 0) { SleepConditionVariableCS(cv, &mu->cs, INFINITE); } else { @@ -99,6 +100,7 @@ int gpr_cv_wait(gpr_cv *cv, gpr_mu *mu, gpr_timespec abs_deadline) { GetLastError() == ERROR_TIMEOUT); } } + mu->locked = 1; return timeout; } |