Consegui sincronizar as threads