Cynthia Nixon has signed on to star opposite Ewan McGregor and Maggie Gyllenhaal in the Roundabout Theater Company’s Broadway revival of “The Real Thing,” the 1982 play in which she appeared in another role on its first run on the Main Stem.

In 1984, Nixon attracted industry attention by acting in simultaneous Broadway productions of “The Real Thing” and “Hurlyburly,” both directed by Mike Nichols. Because the thesp portrayed characters that appeared only in discrete sections of each play, she could run back and forth between the two to fulfill her duties in both titles.

In the upcoming revival of “The Real Thing,” Nixon will play Charlotte, the actress wife of the playwright Henry, played by McGregor. Gyllenhaal will portrays Annie, the woman with whom Henry has an affair.

The first time around, Nixon played Debbie, the teenage daughter of Charlotte and Henry. She has previously appeared in Roundabout productions of “The Women” and “Distracted.”

Helmed by Sam Gold, “Real Thing” starts previews Oct. 2 ahead of an Oct. 30 opening at the American Airlines Theater.