AF limit detection in thread