From 5b6da64e35bcee9471a698fa2dca7e6c33fbf11a Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Sun, 1 Dec 2013 14:41:43 +0100 Subject: [PATCH] [entropy.db.skel] document further locking infrastructure assumptions --- lib/entropy/db/skel.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/lib/entropy/db/skel.py b/lib/entropy/db/skel.py index b30475e11..f0921b99e 100644 --- a/lib/entropy/db/skel.py +++ b/lib/entropy/db/skel.py @@ -431,6 +431,11 @@ class EntropyRepositoryBase(TextInterface, EntropyRepositoryPluginStore): """ Acquire a shared file lock for this repository (context manager). This is used for inter-process synchronization only. + + This locking infrastructure assumes that resources initialized during + object instantiation are valid throughout the whole object lifecycle. + If this is not the case, please synchronize using the Entropy Resources + General Lock (entropy.tools.acquire_entropy_locks()). """ acquired = False try: @@ -469,6 +474,11 @@ class EntropyRepositoryBase(TextInterface, EntropyRepositoryPluginStore): """ Acquire an exclusive file lock for this repository (context manager). This is used for inter-process synchronization only. + + This locking infrastructure assumes that resources initialized during + object instantiation are valid throughout the whole object lifecycle. + If this is not the case, please synchronize using the Entropy Resources + General Lock (entropy.tools.acquire_entropy_locks()). """ acquired = False try: @@ -506,6 +516,11 @@ class EntropyRepositoryBase(TextInterface, EntropyRepositoryPluginStore): """ Acquire a shared file lock for this repository. This is used for inter-process synchronization only. + + This locking infrastructure assumes that resources initialized during + object instantiation are valid throughout the whole object lifecycle. + If this is not the case, please synchronize using the Entropy Resources + General Lock (entropy.tools.acquire_entropy_locks()). """ raise NotImplementedError() @@ -513,6 +528,11 @@ class EntropyRepositoryBase(TextInterface, EntropyRepositoryPluginStore): """ Acquire an exclusive file lock for this repository. This is used for inter-process synchronization only. + + This locking infrastructure assumes that resources initialized during + object instantiation are valid throughout the whole object lifecycle. + If this is not the case, please synchronize using the Entropy Resources + General Lock (entropy.tools.acquire_entropy_locks()). """ raise NotImplementedError() @@ -521,6 +541,11 @@ class EntropyRepositoryBase(TextInterface, EntropyRepositoryPluginStore): Try to acquire a shared file lock for this repository. This is used for inter-process synchronization only. + This locking infrastructure assumes that resources initialized during + object instantiation are valid throughout the whole object lifecycle. + If this is not the case, please synchronize using the Entropy Resources + General Lock (entropy.tools.acquire_entropy_locks()). + @return: True, if acquired, False otherwise. @rtype: bool """ @@ -531,6 +556,11 @@ class EntropyRepositoryBase(TextInterface, EntropyRepositoryPluginStore): Try to acquire an exclusive file lock for this repository. This is used for inter-process synchronization only. + This locking infrastructure assumes that resources initialized during + object instantiation are valid throughout the whole object lifecycle. + If this is not the case, please synchronize using the Entropy Resources + General Lock (entropy.tools.acquire_entropy_locks()). + @return: True, if acquired, False otherwise. @rtype: bool """