New: Add value to VisitedThreadSet or check if it exists