[ovs-dev] [PATCH 3/4] ovs-thread: Drop xpthread_meutex_{un}lock finctions.

Ilya Maximets i.maximets at samsung.com
Mon Dec 10 17:05:22 UTC 2018


There are no users of these functions.
This change fixes clang build on FreeBSD:

  lib/ovs-thread.c:158:1: error: \
      mutex 'mutex' is still held at the end of function \
      [-Werror,-Wthread-safety-analysis]
  XPTHREAD_FUNC1(pthread_mutex_lock, pthread_mutex_t *);
  ^
  lib/ovs-thread.c:138:5: note: expanded from macro 'XPTHREAD_FUNC1'
      }
      ^

Fixes: 4dff0893c376 ("ovs-atomic-pthreads: Use global shared locks for atomic_flag also.")
Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
---
 lib/ovs-thread.c | 2 --
 lib/ovs-thread.h | 5 -----
 2 files changed, 7 deletions(-)

diff --git a/lib/ovs-thread.c b/lib/ovs-thread.c
index c72bc543b..b5f7424b7 100644
--- a/lib/ovs-thread.c
+++ b/lib/ovs-thread.c
@@ -155,8 +155,6 @@ UNLOCK_FUNCTION(rwlock, destroy, NULL);
         }                                               \
     }
 
-XPTHREAD_FUNC1(pthread_mutex_lock, pthread_mutex_t *);
-XPTHREAD_FUNC1(pthread_mutex_unlock, pthread_mutex_t *);
 XPTHREAD_FUNC1(pthread_mutexattr_init, pthread_mutexattr_t *);
 XPTHREAD_FUNC1(pthread_mutexattr_destroy, pthread_mutexattr_t *);
 XPTHREAD_FUNC2(pthread_mutexattr_settype, pthread_mutexattr_t *, int);
diff --git a/lib/ovs-thread.h b/lib/ovs-thread.h
index 0f9663324..1050fc29a 100644
--- a/lib/ovs-thread.h
+++ b/lib/ovs-thread.h
@@ -33,11 +33,6 @@ struct ovs_barrier {
     struct seq *seq;
 };
 
-/* Wrappers for pthread_mutex_*() that abort the process on any error.
- * This is still needed when ovs-atomic-pthreads.h is used. */
-void xpthread_mutex_lock(pthread_mutex_t *mutex);
-void xpthread_mutex_unlock(pthread_mutex_t *mutex);
-
 /* Wrappers for pthread_mutexattr_*() that abort the process on any error. */
 void xpthread_mutexattr_init(pthread_mutexattr_t *);
 void xpthread_mutexattr_destroy(pthread_mutexattr_t *);
-- 
2.17.1



More information about the dev mailing list