fix build for non debug threads