Set thread flag to volatile