mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +01:00
add assert to verify no need for mutex
This commit is contained in:
parent
dff130d6c6
commit
b24d60e7bf
1 changed files with 6 additions and 0 deletions
|
@ -185,6 +185,7 @@ class Device():
|
|||
self.nTilesLeftTray = None
|
||||
self.relayID = None
|
||||
self.relaySeed = 0
|
||||
self.locked = False
|
||||
|
||||
with open(self.logPath, "w") as log:
|
||||
log.write('New cmdline: ' + self.app + ' ' + (' '.join([str(p) for p in self.params])))
|
||||
|
@ -200,6 +201,8 @@ class Device():
|
|||
nLines += 1
|
||||
log.write(line + os.linesep)
|
||||
|
||||
self.locked = True
|
||||
|
||||
# check for connname
|
||||
if not self.connname:
|
||||
match = Device.sConnNamePat.match(line)
|
||||
|
@ -228,6 +231,8 @@ class Device():
|
|||
self.relaySeed = int(match.group(1))
|
||||
self.relayID = match.group(2)
|
||||
|
||||
self.locked = False
|
||||
|
||||
# print('logReaderMain done, wrote lines:', nLines, 'to', self.logPath);
|
||||
|
||||
def launch(self):
|
||||
|
@ -293,6 +298,7 @@ class Device():
|
|||
print('got exception sending to', url, params, '; is relay.py running as apache module?')
|
||||
|
||||
def getTilesCount(self):
|
||||
assert not self.locked
|
||||
return {'index': self.indx,
|
||||
'nTilesLeftPool': self.nTilesLeftPool,
|
||||
'nTilesLeftTray': self.nTilesLeftTray,
|
||||
|
|
Loading…
Add table
Reference in a new issue