[FIX] hw_{scanner,escpos}: ensure we always release the lock.
[FIX] hw_scanner: mark the thread as deamon. bzr revid: chs@openerp.com-20140329144146-utr8gexna4un65u1
This commit is contained in:
parent
2d0d198498
commit
37c469c5cd
|
@ -51,11 +51,10 @@ class EscposDriver(Thread):
|
|||
return connected
|
||||
|
||||
def lockedstart(self):
|
||||
self.lock.acquire()
|
||||
if not self.isAlive():
|
||||
self.daemon = True
|
||||
self.start()
|
||||
self.lock.release()
|
||||
with self.lock:
|
||||
if not self.isAlive():
|
||||
self.daemon = True
|
||||
self.start()
|
||||
|
||||
def get_escpos_printer(self):
|
||||
try:
|
||||
|
|
|
@ -88,10 +88,10 @@ class Scanner(Thread):
|
|||
}
|
||||
|
||||
def lockedstart(self):
|
||||
self.lock.acquire()
|
||||
if not self.isAlive():
|
||||
self.start()
|
||||
self.lock.release()
|
||||
with self.lock:
|
||||
if not self.isAlive():
|
||||
self.daemon = True
|
||||
self.start()
|
||||
|
||||
def set_status(self, status, message = None):
|
||||
if status == self.status['status']:
|
||||
|
|
Loading…
Reference in New Issue