Revision d4803c24 lib/locking.py

b/lib/locking.py
390 390
    Used only for debugging purposes.
391 391

  
392 392
    """
393
    self.__lock.acquire(shared=1)
393
    # If we don't already own the set-level lock acquired
394
    # we'll get it and note we need to release it later.
395
    release_lock = False
396
    if not self.__lock._is_owned():
397
      release_lock = True
398
      self.__lock.acquire(shared=1)
394 399
    try:
395 400
      result = self.__names()
396 401
    finally:
397
      self.__lock.release()
402
      if release_lock:
403
        self.__lock.release()
398 404
    return set(result)
399 405

  
400 406
  def acquire(self, names, blocking=1, shared=0):

Also available in: Unified diff