This fixes build with clang on FreeBSD:
lib/ovs-thread.c:266:13: error:
calling function 'pthread_cond_wait' requires holding mutex \
'mutex->lock' exclusively [-Werror,-Wthread-safety-analysis]
error = pthread_cond_wait(cond, &mutex->lock);
^
Fixes: 97be153858b4 ("clang: Add annotations for thread safety check.")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
#define ovs_mutex_trylock(mutex) \
ovs_mutex_trylock_at(mutex, OVS_SOURCE_LOCATOR)
-void ovs_mutex_cond_wait(pthread_cond_t *, const struct ovs_mutex *);
+void ovs_mutex_cond_wait(pthread_cond_t *, const struct ovs_mutex *mutex)
+ OVS_REQUIRES(mutex);
\f
/* Convenient once-only execution.
*
* call with calls to ovsrcu_quiesce_start() and ovsrcu_quiesce_end(). */
void
ovs_mutex_cond_wait(pthread_cond_t *cond, const struct ovs_mutex *mutex_)
+ OVS_NO_THREAD_SAFETY_ANALYSIS
{
struct ovs_mutex *mutex = CONST_CAST(struct ovs_mutex *, mutex_);
int error;