Use atomic flags for the thunk array