Revision a71f9c7d
b/lib/jqueue.py | ||
---|---|---|
558 | 558 |
functions usually called from other classes. Note that this should |
559 | 559 |
be applied only to methods (not plain functions), since it expects |
560 | 560 |
that the decorated function is called with a first argument that has |
561 |
a '_queue_lock' argument. |
|
561 |
a '_queue_filelock' argument.
|
|
562 | 562 |
|
563 | 563 |
@warning: Use this decorator only after utils.LockedMethod! |
564 | 564 |
|
... | ... | |
571 | 571 |
""" |
572 | 572 |
def wrapper(self, *args, **kwargs): |
573 | 573 |
# pylint: disable-msg=W0212 |
574 |
assert self._queue_lock is not None, "Queue should be open" |
|
574 |
assert self._queue_filelock is not None, "Queue should be open"
|
|
575 | 575 |
return fn(self, *args, **kwargs) |
576 | 576 |
return wrapper |
577 | 577 |
|
... | ... | |
606 | 606 |
self.acquire = self._lock.acquire |
607 | 607 |
self.release = self._lock.release |
608 | 608 |
|
609 |
# Initialize |
|
610 |
self._queue_lock = jstore.InitAndVerifyQueue(must_lock=True) |
|
609 |
# Initialize the queue, and acquire the filelock. |
|
610 |
# This ensures no other process is working on the job queue. |
|
611 |
self._queue_filelock = jstore.InitAndVerifyQueue(must_lock=True) |
|
611 | 612 |
|
612 | 613 |
# Read serial file |
613 | 614 |
self._last_serial = jstore.ReadSerial() |
... | ... | |
1414 | 1415 |
""" |
1415 | 1416 |
self._wpool.TerminateWorkers() |
1416 | 1417 |
|
1417 |
self._queue_lock.Close() |
|
1418 |
self._queue_lock = None |
|
1418 |
self._queue_filelock.Close() |
|
1419 |
self._queue_filelock = None |
Also available in: Unified diff