def run(self):
method = self.__method
echo_buf = self.echo_buf
run_lock = self.__run_lock
while True:
run_lock.acquire()
check = self.check
print(self.name, 'start')
while True:
try:
method(echo_buf)
except IOError as exc:
if exc.errno == errno.ESHUTDOWN:
break
if exc.errno not in (errno.EINTR, errno.EAGAIN):
raise
if check():
self.ep_file.halt()
print(self.name, 'exit')
run_lock.acquire(False)
评论列表
文章目录