[Checkins] [zopefoundation/ZODB] 532fd7: Modernize and cleanup locking

GitHub noreply at github.com
Sat Jun 18 15:59:56 CEST 2016


  Branch: refs/heads/clean-up-locking
  Home:   https://github.com/zopefoundation/ZODB
  Commit: 532fd78a10e2fe0c468e2b4241fe9b6c8377cbd7
      https://github.com/zopefoundation/ZODB/commit/532fd78a10e2fe0c468e2b4241fe9b6c8377cbd7
  Author: Jim Fulton <jim at zope.com>
  Date:   2016-06-18 (Sat, 18 Jun 2016)

  Changed paths:
    M src/ZODB/ActivityMonitor.py
    M src/ZODB/BaseStorage.py
    M src/ZODB/DB.py
    M src/ZODB/DemoStorage.py
    M src/ZODB/FileStorage/FileStorage.py
    M src/ZODB/FileStorage/fspack.py
    M src/ZODB/FileStorage/interfaces.py
    M src/ZODB/MappingStorage.py
    M src/ZODB/blob.py
    M src/ZODB/scripts/zodbload.py
    M src/ZODB/tests/MVCCMappingStorage.py
    M src/ZODB/tests/testDemoStorage.py
    M src/ZODB/tests/test_storage.py
    M src/ZODB/utils.py
    M src/ZODB/utils.txt

  Log Message:
  -----------
  Modernize and cleanup locking

- Move from try/finally to with

- Start phasing out the _lock_acquire/_lock_release shortcuts

- Replace simpler @locked decorators with with statements.

  I've come to prefer the with style tp the decorator style.
  I think it's clearer.

  (The decorators preceeded the Python with statement.)

  I left the decorators in cases where they were used with preconditions.

This is mostly pretty mechanical, although it got a little delicate in
places and ... tests




More information about the checkins mailing list