[Fix]Close #750,增加RpcServer停止时的join选项
This commit is contained in:
parent
00f9da4c68
commit
a89d64dc32
@ -136,13 +136,13 @@ class RpcServer(RpcObject):
|
|||||||
self.__thread.start()
|
self.__thread.start()
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
def stop(self):
|
def stop(self, join=False):
|
||||||
"""停止服务器"""
|
"""停止服务器"""
|
||||||
# 将服务器设为停止
|
# 将服务器设为停止
|
||||||
self.__active = False
|
self.__active = False
|
||||||
|
|
||||||
# 等待工作线程退出
|
# 等待工作线程退出
|
||||||
if self.__thread.isAlive():
|
if join and self.__thread.isAlive():
|
||||||
self.__thread.join()
|
self.__thread.join()
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user