]> git.sesse.net Git - vlc/commitdiff
pthread: mark bugs as unlikely
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 17 Jan 2010 10:12:32 +0000 (12:12 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 17 Jan 2010 10:14:11 +0000 (12:14 +0200)
src/misc/pthread.c

index 137916362b3fdeeb3ce0e3afcdc1e7cdcc4d1165..ac45a9961387a89f9bbc1b6f655cb5d81fb42937 100644 (file)
@@ -125,7 +125,8 @@ vlc_thread_fatal (const char *action, int error,
 }
 
 # define VLC_THREAD_ASSERT( action ) \
-    if (val) vlc_thread_fatal (action, val, __func__, __FILE__, __LINE__)
+    if (unlikely(val)) \
+        vlc_thread_fatal (action, val, __func__, __FILE__, __LINE__)
 #else
 # define VLC_THREAD_ASSERT( action ) ((void)val)
 #endif
@@ -700,7 +701,7 @@ void vlc_restorecancel (int state)
     /* This should fail if an invalid value for given for state */
     VLC_THREAD_ASSERT ("restoring cancellation");
 
-    if (oldstate != PTHREAD_CANCEL_DISABLE)
+    if (unlikely(oldstate != PTHREAD_CANCEL_DISABLE))
          vlc_thread_fatal ("restoring cancellation while not disabled", EINVAL,
                            __func__, __FILE__, __LINE__);
 #else