mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 14:35:46 +02:00
...
This commit is contained in:
parent
dba9397a5e
commit
28ca52be0b
1 changed files with 7 additions and 2 deletions
|
|
@ -57,7 +57,7 @@ def call_func_with_lock(*args, **kwargs):
|
|||
return func(*args, **kwargs)
|
||||
except DowngradeLockError:
|
||||
# We already have an exclusive lock, no need to acquire a shared
|
||||
# lock. See the safe_read_lock properties documentation for why
|
||||
# lock. See the safe_read_lock properties' documentation for why
|
||||
# this is necessary.
|
||||
return func(*args, **kwargs)
|
||||
return call_func_with_lock
|
||||
|
|
@ -123,7 +123,12 @@ def safe_read_lock(self):
|
|||
search cache in the presence of composite columns. Updating the search
|
||||
cache holds an exclusive lock, but searching a composite column
|
||||
involves reading field values via ProxyMetadata which tries to get a
|
||||
shared lock. There may be other scenarios that trigger this as well. '''
|
||||
shared lock. There may be other scenarios that trigger this as well.
|
||||
|
||||
This property returns a new lock object on every access. This lock
|
||||
object is not recursive (for performance) and must only be used in a
|
||||
with statement as ``with cache.safe_read_lock:`` otherwise bad things
|
||||
will happen.'''
|
||||
return SafeReadLock(self.read_lock)
|
||||
|
||||
@write_api
|
||||
|
|
|
|||
Loading…
Reference in a new issue