It's a Greek myth. After Theseus killed the Minotaur(inspiration for the Nimon), Theseus was to return to his father on a ship. He promised that if the ship was flying white sails, this meant Theseus had lived. He forgot, and his father saw the sails were black and jumped into the sea. The Doctor is alluding to this.