]> git.sesse.net Git - vlc/blobdiff - src/misc/threads.c
libvlccore: remove the threads count
[vlc] / src / misc / threads.c
index ce820b6c6693b3406a69f91adb3e28433dd42183..b1983926ddd9eccb97a918da1422592f5fba1e73 100644 (file)
@@ -480,7 +480,6 @@ int __vlc_thread_create( vlc_object_t *p_this, const char * psz_file, int i_line
 {
     int i_ret;
     vlc_object_internals_t *p_priv = vlc_internals( p_this );
-    libvlc_priv_t *libpriv = libvlc_priv (p_this->p_libvlc);
 
     struct vlc_thread_boot *boot = malloc (sizeof (*boot));
     if (boot == NULL)
@@ -488,10 +487,6 @@ int __vlc_thread_create( vlc_object_t *p_this, const char * psz_file, int i_line
     boot->entry = func;
     boot->object = p_this;
 
-    vlc_mutex_lock (&libpriv->threads_lock);
-    libpriv->threads_count++;
-    vlc_mutex_unlock (&libpriv->threads_lock);
-
     vlc_object_lock( p_this );
 
     /* Make sure we don't re-create a thread if the object has already one */
@@ -598,14 +593,6 @@ int __vlc_thread_create( vlc_object_t *p_this, const char * psz_file, int i_line
     }
 
     vlc_object_unlock( p_this );
-
-    if (i_ret)
-    {
-        vlc_mutex_lock (&libpriv->threads_lock);
-        if (--libpriv->threads_count == 0)
-            vlc_cond_signal (&libpriv->threads_wait);
-        vlc_mutex_unlock (&libpriv->threads_lock);
-    }
     return i_ret;
 }
 
@@ -766,19 +753,8 @@ error:
                          (unsigned long)p_priv->thread_id, psz_file, i_line );
     }
     else
-    {
-        libvlc_priv_t *libpriv = libvlc_priv (p_this->p_libvlc);
         msg_Dbg( p_this, "thread %lu joined (%s:%d)",
                          (unsigned long)p_priv->thread_id, psz_file, i_line );
-        vlc_mutex_lock (&libpriv->threads_lock);
-#ifndef NDEBUG
-        libpriv->threads_count--;
-#else
-        if (--libpriv->threads_count == 0)
-#endif
-            vlc_cond_signal (&libpriv->threads_wait);
-        vlc_mutex_unlock (&libpriv->threads_lock);
-    }
 
     p_priv->b_thread = false;
 }