Revision f8a4adfa lib/jqueue.py
b/lib/jqueue.py | ||
---|---|---|
217 | 217 |
obj.writable = writable |
218 | 218 |
obj.ops_iter = None |
219 | 219 |
obj.cur_opctx = None |
220 |
obj.processor_lock = threading.Lock() |
|
220 |
|
|
221 |
# Read-only jobs are not processed and therefore don't need a lock |
|
222 |
if writable: |
|
223 |
obj.processor_lock = threading.Lock() |
|
224 |
else: |
|
225 |
obj.processor_lock = None |
|
221 | 226 |
|
222 | 227 |
def __repr__(self): |
223 | 228 |
status = ["%s.%s" % (self.__class__.__module__, self.__class__.__name__), |
... | ... | |
1231 | 1236 |
@param job: the job to be processed |
1232 | 1237 |
|
1233 | 1238 |
""" |
1239 |
assert job.writable, "Expected writable job" |
|
1240 |
|
|
1234 | 1241 |
# Ensure only one worker is active on a single job. If a job registers for |
1235 | 1242 |
# a dependency job, and the other job notifies before the first worker is |
1236 | 1243 |
# done, the job can end up in the tasklist more than once. |
Also available in: Unified diff