diff options
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); } } |