aboutsummaryrefslogtreecommitdiff
path: root/lib/ovs-thread.h
diff options
context:
space:
mode:
authorAlex Wang <alexw@nicira.com>2013-07-31 16:09:11 -0700
committerBen Pfaff <blp@nicira.com>2013-07-31 16:07:46 -0700
commit13d94ee9c8c5e031a6fb46903802c56784c4d410 (patch)
tree4cf2043e5d92504fad5d8c1f62dda910139b434b /lib/ovs-thread.h
parent431495b10f1c3aa577b8306ad996c41ff0581309 (diff)
ovs-atomic-pthreads: Fix "has incomplete type" error.
Commit 97be153858b4cd175cbe7862b8e1624bf22ab98a (clang: Add annotations for thread safety check.) defined 'struct ovs_mutex' variable in 'atomic_flag' in 'ovs-atomic-pthreads.h'. This casued "mutex: has incomplete type" error in compilation when 'ovs-atomic-pthreads.h' is included. This commit goes back to use 'pthread_mutex_t' for that variable and adds test for the 'atomic_flag' related functions. Reported-by: Gurucharan Shetty <gshetty@nicira.com> Signed-off-by: Alex Wang <alexw@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/ovs-thread.h')
-rw-r--r--lib/ovs-thread.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/ovs-thread.h b/lib/ovs-thread.h
index f5e171ac..9b8eeef3 100644
--- a/lib/ovs-thread.h
+++ b/lib/ovs-thread.h
@@ -84,6 +84,11 @@ int ovs_mutex_trylock_at(const struct ovs_mutex *mutex, const char *where)
void ovs_mutex_cond_wait(pthread_cond_t *, const struct ovs_mutex *);
+/* 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 *);