Simplified autoresetevent code.
Increased timeout to 5s.