timedwait added
Merge pull request #3783 from amitmurthy/amitm/twait

Alternative implementation of timedwait