aboutsummaryrefslogtreecommitdiff
path: root/migration.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2013-05-13 13:29:47 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2013-07-04 17:42:49 +0200
commit5444e768ee1abe6e021bece19a9a932351f88c88 (patch)
tree944d3e69c83659ecd706ca2d24023d9c9c2a82c7 /migration.c
parent22fc860b0a0b689eacf4a01f5aa2ccbf36043a12 (diff)
downloadqemu-arm-5444e768ee1abe6e021bece19a9a932351f88c88.tar.gz
add a header file for atomic operations
We're already using them in several places, but __sync builtins are just too ugly to type, and do not provide seqcst load/store operations. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'migration.c')
-rw-r--r--migration.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/migration.c b/migration.c
index a704d48669..635a7e7a08 100644
--- a/migration.c
+++ b/migration.c
@@ -293,8 +293,7 @@ static void migrate_fd_cleanup(void *opaque)
static void migrate_finish_set_state(MigrationState *s, int new_state)
{
- if (__sync_val_compare_and_swap(&s->state, MIG_STATE_ACTIVE,
- new_state) == new_state) {
+ if (atomic_cmpxchg(&s->state, MIG_STATE_ACTIVE, new_state) == new_state) {
trace_migrate_set_state(new_state);
}
}