diff options
author | Ilya Maximets <i.maximets@samsung.com> | 2018-12-10 20:05:23 +0300 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2018-12-10 09:52:55 -0800 |
commit | 5f361a2a320717c46289fc30d65a186f2f5d3ba0 (patch) | |
tree | 0cebf37e25d3e83a3618bcfa899bc1a8b5cea29b /lib/ovs-thread.c | |
parent | 6fe27a7103698bf347c583f3c4199e87006da6f9 (diff) | |
download | openvswitch-5f361a2a320717c46289fc30d65a186f2f5d3ba0.tar.gz |
ovs-thread: Add thread safety annotation to cond_wait.
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>
Diffstat (limited to 'lib/ovs-thread.c')
-rw-r--r-- | lib/ovs-thread.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/ovs-thread.c b/lib/ovs-thread.c index b5f7424b7..c8d92bc1b 100644 --- a/lib/ovs-thread.c +++ b/lib/ovs-thread.c @@ -257,6 +257,7 @@ ovs_rwlock_init(const struct ovs_rwlock *l_) * 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; |