From 006ce4b6bfc7e8d4867c563a8d00386189a83e3d Mon Sep 17 00:00:00 2001
From: Geoffroy Couprie <geo.couprie@gmail.com>
Date: Wed, 10 Sep 2008 14:21:25 +0200
Subject: [PATCH] Set &p_mutex->owner to zero while releasing

---
 src/misc/threads.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/misc/threads.c b/src/misc/threads.c
index e12bef2..56ab305 100644
--- a/src/misc/threads.c
+++ b/src/misc/threads.c
@@ -384,7 +384,7 @@ void vlc_mutex_unlock (vlc_mutex_t *p_mutex)
 
         /* We release the mutex */
         DWORD self = GetCurrentThreadId ();
-        self = InterlockedCompareExchange (&p_mutex->owner, self, 0);
+        self = InterlockedCompareExchange (&p_mutex->owner, 0, self);
         assert (self == GetCurrentThreadId ());
         /* fall through */
     }
-- 
1.5.6.4

