aboutsummaryrefslogtreecommitdiff
path: root/lib/ovs-atomic-pthreads.c
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-atomic-pthreads.c
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-atomic-pthreads.c')
-rw-r--r--lib/ovs-atomic-pthreads.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/ovs-atomic-pthreads.c b/lib/ovs-atomic-pthreads.c
index 7e7ef050..a501b825 100644
--- a/lib/ovs-atomic-pthreads.c
+++ b/lib/ovs-atomic-pthreads.c
@@ -26,10 +26,10 @@ atomic_flag_test_and_set(volatile atomic_flag *flag_)
atomic_flag *flag = CONST_CAST(atomic_flag *, flag_);
bool old_value;
- ovs_mutex_lock(&flag->mutex);
+ xpthread_mutex_lock(&flag->mutex);
old_value = flag->b;
flag->b = true;
- ovs_mutex_unlock(&flag->mutex);
+ xpthread_mutex_unlock(&flag->mutex);
return old_value;
}
@@ -46,9 +46,9 @@ atomic_flag_clear(volatile atomic_flag *flag_)
{
atomic_flag *flag = CONST_CAST(atomic_flag *, flag_);
- ovs_mutex_lock(&flag->mutex);
+ xpthread_mutex_lock(&flag->mutex);
flag->b = false;
- ovs_mutex_unlock(&flag->mutex);
+ xpthread_mutex_unlock(&flag->mutex);
}
void