Commit 49674e45 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

pthread: mark bugs as unlikely

parent 5c66bbbf
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment