Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristian-Valeriu Soare2018-11-13 12:46:44 +0000
committerEugene Tarassov2018-11-13 23:01:01 +0000
commitc82596351776484bef0f9fff8515fc392f23340a (patch)
tree07f6c3af97d1bc285b752fd1a7d56f9ffa6ec066
parent5c2f782571194387d50740771642c469d82eb15d (diff)
downloadorg.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.c5
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);

Back to the top