I feel stupid..but this is a serious question!

Could masturbating cause labor? I did it for the first time in my pregnancy and I'm 35 weeks and I'm nervous it could cause labor.. My doctor told me no sex cause of my preterm labor problems with my first son.. 
I didn't even think of it possibly causing labor until after.. /: