Processor.ExecOpCode) set to OP_STATUS_WAITLOCK.
"""
- self._queue.acquire()
+ self._queue.acquire(shared=1)
try:
assert self._op.status in (constants.OP_STATUS_WAITLOCK,
constants.OP_STATUS_CANCELING)
finally:
self._queue.release()
- @locking.ssynchronized(_big_jqueue_lock)
+ @locking.ssynchronized(_big_jqueue_lock, shared=1)
def _AppendFeedback(self, timestamp, log_type, log_msg):
"""Internal feedback append function, with locks
logging.info("Op %s/%s: Starting opcode %s", idx + 1, count,
op_summary)
- queue.acquire()
+ queue.acquire(shared=1)
try:
if op.status == constants.OP_STATUS_CANCELED:
raise CancelJob()
result = proc.ExecOpCode(input_opcode,
_OpExecCallbacks(queue, job, op))
- queue.acquire()
+ queue.acquire(shared=1)
try:
op.status = constants.OP_STATUS_SUCCESS
op.result = result
# Will be handled further up
raise
except Exception, err:
- queue.acquire()
+ queue.acquire(shared=1)
try:
try:
op.status = constants.OP_STATUS_ERROR
raise
except CancelJob:
- queue.acquire()
+ queue.acquire(shared=1)
try:
job.MarkUnfinishedOps(constants.OP_STATUS_CANCELED,
"Job canceled by request")
except:
logging.exception("Unhandled exception")
finally:
- queue.acquire()
+ queue.acquire(shared=1)
try:
try:
job.lock_status = None