[vlc-devel] [PATCH 3/5] vlccore: fix a linked list of threadvar on OS/2
KO Myung-Hun
komh78 at gmail.com
Sat Mar 2 16:11:08 CET 2013
---
src/os2/thread.c | 9 +++++++--
1 files 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 );
--
1.7.3.2
More information about the vlc-devel
mailing list