Add threading lock to display thread