mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-01-30 19:24:31 +03:00
Merge branch 'release/4.3.7' into master
This commit is contained in:
commit
26a89d664b
|
@ -13,3 +13,4 @@ Dependency Injector Contributors
|
|||
+ Bruno P. Kinoshita (kinow)
|
||||
+ RobinsonMa (RobinsonMa)
|
||||
+ Rüdiger Busche (JarnoRFB)
|
||||
+ Dmitry Rassoshenko (rda-dev)
|
||||
|
|
|
@ -7,6 +7,12 @@ that were made in every particular version.
|
|||
From version 0.7.6 *Dependency Injector* framework strictly
|
||||
follows `Semantic versioning`_
|
||||
|
||||
4.3.7
|
||||
-----
|
||||
- Fix race in ``ThreadSafeSingleton``. Many thanks to
|
||||
`Dmitry Rassoshenko aka rda-dev <https://github.com/rda-dev>`_ for the pull request
|
||||
(See PR `#322 <https://github.com/ets-labs/python-dependency-injector/pull/322>`_).
|
||||
|
||||
4.3.6
|
||||
-----
|
||||
- Fix changelog typo.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
"""Top-level package."""
|
||||
|
||||
__version__ = '4.3.6'
|
||||
__version__ = '4.3.7'
|
||||
"""Version number.
|
||||
|
||||
:type: str
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -2178,15 +2178,19 @@ cdef class ThreadSafeSingleton(BaseSingleton):
|
|||
|
||||
:rtype: None
|
||||
"""
|
||||
self.__storage = None
|
||||
with self.__storage_lock:
|
||||
self.__storage = None
|
||||
|
||||
cpdef object _provide(self, tuple args, dict kwargs):
|
||||
"""Return single instance."""
|
||||
with self.__storage_lock:
|
||||
if self.__storage is None:
|
||||
self.__storage = __factory_call(self.__instantiator,
|
||||
args, kwargs)
|
||||
return self.__storage
|
||||
storage = self.__storage
|
||||
if storage is None:
|
||||
with self.__storage_lock:
|
||||
if self.__storage is None:
|
||||
self.__storage = __factory_call(self.__instantiator,
|
||||
args, kwargs)
|
||||
storage = self.__storage
|
||||
return storage
|
||||
|
||||
|
||||
cdef class DelegatedThreadSafeSingleton(ThreadSafeSingleton):
|
||||
|
|
Loading…
Reference in New Issue
Block a user