[vlc-devel] commit: pthread: mark bugs as unlikely ( Rémi Denis-Courmont )

git version control git at videolan.org
Sun Jan 17 11:14:54 CET 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jan 17 12:12:32 2010 +0200| [49674e452486c9de5c7f6af12f14b2b0015b261b] | committer: Rémi Denis-Courmont 

pthread: mark bugs as unlikely

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

 src/misc/pthread.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/misc/pthread.c b/src/misc/pthread.c
index 1379163..ac45a99 100644
--- a/src/misc/pthread.c
+++ b/src/misc/pthread.c
@@ -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




More information about the vlc-devel mailing list