- if sleepresult == 2:
- # Cancel keep-alive, but don't bother terminating threads
- for item in kaobjs:
- item.stopkeepalive(abrupt = 1)
- return sleepresult
- else:
- # Cancel keep-alive and wait for thread to terminate.
- for item in kaobjs:
- item.stopkeepalive(abrupt = 0)
- return sleepresult