flag for thread