Message141169
Why you create variable mirror?
--------------------------
self.__running = False
self.__is_shut_down.set()
--------------------------
You other code is racy. exception may occur at any time.
Why not to test state of __is_shut_down directly ? In any case, server either running either not (i.e. is_shitdown or not is_shutdown). Server should not be tri-state in any case, as I think.
As the latest thing, that serve_forever does - is the calling self.__is_shut_down.set(). So it is reliable to detect state of the server via state of this lock. |
|
Date |
User |
Action |
Args |
2011-07-26 16:39:29 | socketpair | set | recipients:
+ socketpair, pitrou, giampaolo.rodola, neologix, santoso.wijaya, petri.lehtinen |
2011-07-26 16:39:29 | socketpair | set | messageid: <1311698369.87.0.796370744712.issue12463@psf.upfronthosting.co.za> |
2011-07-26 16:39:29 | socketpair | link | issue12463 messages |
2011-07-26 16:39:29 | socketpair | create | |
|