minor update

This commit is contained in:
Miroslav Stampar 2011-05-29 23:33:34 +00:00
parent 86455ceb9c
commit 6fd8602f01
2 changed files with 46 additions and 31 deletions

View File

@ -341,13 +341,19 @@ def errorUse(expression, expected=None, resumeValue=True, dump=False):
output = __errorFields(expression, expressionFields, expressionFieldsList, expected, num, resumeValue)
if not kb.threadContinue:
break
if output and isinstance(output, list) and len(output) == 1:
output = output[0]
kb.locks.outputs.acquire()
threadData.shared.outputs.append(output)
kb.locks.outputs.release()
except KeyboardInterrupt:
kb.threadContinue = False
kb.threadException = True
raise
runThreads(numThreads, errorThread)

View File

@ -273,6 +273,7 @@ def unionUse(expression, unpack=True, dump=False):
threadData.shared.value = ""
def unionThread():
try:
threadData = getCurrentThreadData()
while threadData.shared.limits and kb.threadContinue:
@ -294,6 +295,9 @@ def unionUse(expression, unpack=True, dump=False):
if not output:
output = __oneShotUnionUse(limitedExpr, unpack)
if not kb.threadContinue:
break
if output:
kb.locks.value.acquire()
threadData.shared.value += output
@ -314,6 +318,11 @@ def unionUse(expression, unpack=True, dump=False):
dataToStdout(status, True)
kb.locks.ioLock.release()
except KeyboardInterrupt:
kb.threadContinue = False
kb.threadException = True
raise
runThreads(numThreads, unionThread)
value = threadData.shared.value