Thornton's deal is worth $17 million and a max value of $18 million, with $6 million guaranteed, a source told ESPN.
Thornton, 27, found his niche with the Philadelphia Eagles as a two-gapping defensive end. During Chip Kelly's three-year tenure, he started 46 of 49 games, including the playoffs. He missed three games in 2015 because of injuries.
With the Eagles switching to a 4-3 defensive front under new defensive coordinator Jim Schwartz, Thornton's value was harder to gauge. He could play tackle, as he did his rookie season, but all of his experience as a starter was in a 3-4 scheme.
Thornton has four career sacks, one in each of his seasons, and has been a consistent run-stopper with 120 solo tackles.
Thornton, who is 6-foot-4, 309 pounds, made the Eagles as an undrafted rookie free agent in 2011. He spent the 2011 season on the team's practice squad. In 2012, Thornton played in all 16 games without making a start.
Also Thursday, the Cowboys reworked the deal of defensive tackle Tyrone Crawford, opening up nearly $4.4 million in cap space.
The Cowboys turned $5.5 million of Crawford's scheduled $6.75 million base salary into a signing bonus, dropping his cap number from $8.75 million to $4.36 million in 2016. It adds $1.1 million in proration to the deal through 2020.
The Cowboys signed Crawford to a five-year, $45 million extension last September and structured it in a way for this to happen.
ESPN Cowboys reporter Todd Archer and ESPN Eagles reporter Phil Sheridan contributed to this report.