I would say that you'll need to first acquire a lock, before changing ret_migration. But you didn't use (read) the value inside the thread, so will not get in trouble with synchronization. (See http://effbot.org/zone/thread-synchronization.htm).