debugging thread read loop