2,639. How to Take an Oath Under Duress
Hilchos Shevuos 3:3
In order for one who is compelled to take an oath to be exempt, he must have some exemption in mind while taking the oath. While the words in a person’s heart are normally not effective, here they are effective because the compulsion keeps him from expressing them verbally.
Hilchos Shevuos 3:4
Pursuant to the previous halacha, if someone took an oath under duress not to eat meat without specifying any conditions, it is permitted if he had the intention that he was saying he wouldn’t eat pig meat, or that he wouldn’t eat meat that day. The same is true in all comparable cases.