[vlc-commits] vlccore: fix a linked list of threadvar on OS/2

KO Myung-Hun git at videolan.org
Sat Mar 2 17:20:45 CET 2013


vlc | branch: master | KO Myung-Hun <komh78 at gmail.com> | Sun Mar  3 00:11:08 2013 +0900| [55963bd7a826f238a7534b8694531b0c1defa6f6] | committer: Rémi Denis-Courmont

vlccore: fix a linked list of threadvar on OS/2

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=55963bd7a826f238a7534b8694531b0c1defa6f6
---

 src/os2/thread.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/os2/thread.c b/src/os2/thread.c
index a6941b9..10072aa 100644
--- a/src/os2/thread.c
+++ b/src/os2/thread.c
@@ -390,6 +390,9 @@ int vlc_threadvar_create (vlc_threadvar_t *p_tls, void (*destr) (void *))
 
     vlc_mutex_lock (&super_mutex);
     var->prev = vlc_threadvar_last;
+    if (var->prev)
+        var->prev->next = var;
+
     vlc_threadvar_last = var;
     vlc_mutex_unlock (&super_mutex);
     return 0;
@@ -402,10 +405,12 @@ void vlc_threadvar_delete (vlc_threadvar_t *p_tls)
     vlc_mutex_lock (&super_mutex);
     if (var->prev != NULL)
         var->prev->next = var->next;
-    else
-        vlc_threadvar_last = var->next;
+
     if (var->next != NULL)
         var->next->prev = var->prev;
+    else
+        vlc_threadvar_last = var->prev;
+
     vlc_mutex_unlock (&super_mutex);
 
     DosFreeThreadLocalMemory( var->id );



More information about the vlc-commits mailing list