It is called charley horse and is a condition more commonly found in males. It usually happens out of heightened sexual arousal, prolonged thrusting (as in your case), electrolyte imbalance, dehydration, alcohol use.
Next Steps
Increase time spent in foreplay and avoid Missionary and Dogy style sex positions
Health Tips
Twice daily calf and thigh stretching exercises are often helpful.