1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-01 13:09:50 +00:00

bitbake: prserv/serv: Rename self.quit -> self.quitflag

self has a quit function and a variable. Separate this to two different
things as the current setup is prone to breakage.

(Bitbake rev: ba7e3c73d8f4d2bd1d7434b97c326e7ab935231a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2017-08-31 17:21:23 +01:00
parent 93a54f3432
commit 6e1ab28e94
+6 -6
View File
@@ -78,7 +78,7 @@ class PRServer(SimpleXMLRPCServer):
bb.utils.set_process_name("PRServ Handler") bb.utils.set_process_name("PRServ Handler")
while not self.quit: while not self.quitflag:
try: try:
(request, client_address) = self.requestqueue.get(True, 30) (request, client_address) = self.requestqueue.get(True, 30)
except queue.Empty: except queue.Empty:
@@ -142,7 +142,7 @@ class PRServer(SimpleXMLRPCServer):
return self.table.importone(version, pkgarch, checksum, value) return self.table.importone(version, pkgarch, checksum, value)
def ping(self): def ping(self):
return not self.quit return not self.quitflag
def getinfo(self): def getinfo(self):
return (self.host, self.port) return (self.host, self.port)
@@ -158,13 +158,13 @@ class PRServer(SimpleXMLRPCServer):
return None return None
def quit(self): def quit(self):
self.quit=True self.quitflag=True
os.write(self.quitpipeout, b"q") os.write(self.quitpipeout, b"q")
os.close(self.quitpipeout) os.close(self.quitpipeout)
return return
def work_forever(self,): def work_forever(self,):
self.quit = False self.quitflag = False
# This timeout applies to the poll in TCPServer, we need the select # This timeout applies to the poll in TCPServer, we need the select
# below to wake on our quit pipe closing. We only ever call into handle_request # below to wake on our quit pipe closing. We only ever call into handle_request
# if there is data there. # if there is data there.
@@ -180,9 +180,9 @@ class PRServer(SimpleXMLRPCServer):
(self.dbfile, self.host, self.port, str(os.getpid()))) (self.dbfile, self.host, self.port, str(os.getpid())))
self.handlerthread.start() self.handlerthread.start()
while not self.quit: while not self.quitflag:
ready = select.select([self.fileno(), self.quitpipein], [], [], 30) ready = select.select([self.fileno(), self.quitpipein], [], [], 30)
if self.quit: if self.quitflag:
break break
if self.fileno() in ready[0]: if self.fileno() in ready[0]:
self.handle_request() self.handle_request()