]> git.sesse.net Git - vlc/blobdiff - src/misc/threads.c
WinCE: switch back vlc_thread_t to an allocated struct
[vlc] / src / misc / threads.c
index 005a0ff731f0896bb2092cb478a21daa533b840c..7b68ce72c467e89bb03096ea95f33b1fd147bbf8 100644 (file)
@@ -148,7 +148,11 @@ int __vlc_thread_set_priority( vlc_object_t *p_this, const char * psz_file,
 #elif defined( WIN32 ) || defined( UNDER_CE )
     VLC_UNUSED( psz_file); VLC_UNUSED( i_line );
 
+#ifndef UNDER_CE
     if( !SetThreadPriority(p_priv->thread_id, i_priority) )
+#else
+    if( !SetThreadPriority(p_priv->thread_id->handle, i_priority) )
+#endif
     {
         msg_Warn( p_this, "couldn't set a faster priority" );
         return 1;
@@ -166,10 +170,7 @@ void __vlc_thread_join( vlc_object_t *p_this )
 {
     vlc_object_internals_t *p_priv = vlc_internals( p_this );
 
-#if defined( LIBVLC_USE_PTHREAD )
-    vlc_join (p_priv->thread_id, NULL);
-
-#elif defined( WIN32 ) && !defined( UNDER_CE )
+#if defined( WIN32 ) && !defined( UNDER_CE )
     HANDLE hThread;
     FILETIME create_ft, exit_ft, kernel_ft, user_ft;
     int64_t real_time, kernel_time, user_time;
@@ -185,9 +186,11 @@ void __vlc_thread_join( vlc_object_t *p_this )
         p_priv->b_thread = false;
         return; /* We have a problem! */
     }
+#endif
 
     vlc_join( p_priv->thread_id, NULL );
 
+#if defined( WIN32 ) && !defined( UNDER_CE )
     /* FIXME: this could work on WinCE too... except that it seems always to
      * return 0 for exit_ft and kernel_ft */
     if( GetThreadTimes( hThread, &create_ft, &exit_ft, &kernel_ft, &user_ft ) )
@@ -215,10 +218,6 @@ void __vlc_thread_join( vlc_object_t *p_this )
                  (double)((user_time%(60*1000000))/1000000.0) );
     }
     CloseHandle( hThread );
-
-#else
-    vlc_join( p_priv->thread_id, NULL );
-
 #endif
 
     p_priv->b_thread = false;