diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2013-05-13 13:29:47 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2013-07-04 17:42:49 +0200 |
commit | 5444e768ee1abe6e021bece19a9a932351f88c88 (patch) | |
tree | 944d3e69c83659ecd706ca2d24023d9c9c2a82c7 /migration.c | |
parent | 22fc860b0a0b689eacf4a01f5aa2ccbf36043a12 (diff) |
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.c | 3 |
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); } } |