diff options
author | Cristian-Valeriu Soare | 2018-11-13 12:46:44 +0000 |
---|---|---|
committer | Eugene Tarassov | 2018-11-13 23:01:01 +0000 |
commit | c82596351776484bef0f9fff8515fc392f23340a (patch) | |
tree | 07f6c3af97d1bc285b752fd1a7d56f9ffa6ec066 | |
parent | 5c2f782571194387d50740771642c469d82eb15d (diff) | |
download | org.eclipse.tcf.agent-c82596351776484bef0f9fff8515fc392f23340a.tar.gz org.eclipse.tcf.agent-c82596351776484bef0f9fff8515fc392f23340a.tar.xz org.eclipse.tcf.agent-c82596351776484bef0f9fff8515fc392f23340a.zip |
TCF Agent: system: fix unlock mutex in special return case
Change-Id: I1c0cda84848127e2255e179538911e1f015c837a
Signed-off-by: Cristian-Valeriu Soare <cristian.soare@intel.com>
-rw-r--r-- | agent/system/Windows/tcf/pthreads-win32.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/agent/system/Windows/tcf/pthreads-win32.c b/agent/system/Windows/tcf/pthreads-win32.c index 857ef04d..1f2aa1bd 100644 --- a/agent/system/Windows/tcf/pthreads-win32.c +++ b/agent/system/Windows/tcf/pthreads-win32.c @@ -448,7 +448,10 @@ int pthread_cond_broadcast(pthread_cond_t * cond) { if (have_waiters) { /* Wake up all the waiters atomically. */ - if (!ReleaseSemaphore(p->sema, p->waiters_count, 0)) return set_win32_errno(GetLastError()); + if (!ReleaseSemaphore(p->sema, p->waiters_count, 0)) { + LeaveCriticalSection(&p->waiters_count_lock); + return set_win32_errno(GetLastError()); + } LeaveCriticalSection(&p->waiters_count_lock); |