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, ...@@ -125,7 +125,8 @@ vlc_thread_fatal (const char *action, int error,
} }
# define VLC_THREAD_ASSERT( action ) \ # 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 #else
# define VLC_THREAD_ASSERT( action ) ((void)val) # define VLC_THREAD_ASSERT( action ) ((void)val)
#endif #endif
...@@ -700,7 +701,7 @@ void vlc_restorecancel (int state) ...@@ -700,7 +701,7 @@ void vlc_restorecancel (int state)
/* This should fail if an invalid value for given for state */ /* This should fail if an invalid value for given for state */
VLC_THREAD_ASSERT ("restoring cancellation"); 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, vlc_thread_fatal ("restoring cancellation while not disabled", EINVAL,
__func__, __FILE__, __LINE__); __func__, __FILE__, __LINE__);
#else #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