Re: [gentoo-portage-dev] [PATCH] bindbapi: add reentrant lock method (bug 685236)

2019-05-10 Thread Zac Medico
On 5/8/19 11:05 AM, Zac Medico wrote: > On 5/7/19 1:01 PM, Zac Medico wrote: >> On 5/7/19 7:55 AM, Alec Warner wrote: >> >>> Also curious why we are not implementing enter and exit so we can avoid >>> unbalanced pairs by using context managers. >>> >>> e.g. in match(), we could likely write: >>>

Re: [gentoo-portage-dev] [PATCH] bindbapi: add reentrant lock method (bug 685236)

2019-05-08 Thread Alec Warner
On Wed, May 8, 2019 at 2:05 PM Zac Medico wrote: > On 5/7/19 1:01 PM, Zac Medico wrote: > > On 5/7/19 7:55 AM, Alec Warner wrote: > > > >> Also curious why we are not implementing enter and exit so we can avoid > >> unbalanced pairs by using context managers. > >> > >> e.g. in match(), we could

Re: [gentoo-portage-dev] [PATCH] bindbapi: add reentrant lock method (bug 685236)

2019-05-08 Thread Zac Medico
On 5/7/19 1:01 PM, Zac Medico wrote: > On 5/7/19 7:55 AM, Alec Warner wrote: > >> Also curious why we are not implementing enter and exit so we can avoid >> unbalanced pairs by using context managers. >> >> e.g. in match(), we could likely write: >> >> with self.dbapi.lock(): >>   # try to match

Re: [gentoo-portage-dev] [PATCH] bindbapi: add reentrant lock method (bug 685236)

2019-05-07 Thread Zac Medico
On 5/7/19 7:55 AM, Alec Warner wrote: > > > On Mon, May 6, 2019 at 8:15 PM Zac Medico > wrote: > > Add a reentrant lock/unlock method which is useful for things like > emaint binhost and eclean-pkg. The vardbapi class already provides > lock/unlock

Re: [gentoo-portage-dev] [PATCH] bindbapi: add reentrant lock method (bug 685236)

2019-05-07 Thread Alec Warner
On Mon, May 6, 2019 at 8:15 PM Zac Medico wrote: > Add a reentrant lock/unlock method which is useful for things like > emaint binhost and eclean-pkg. The vardbapi class already provides > lock/unlock methods that behave the same way. > Curious why we are not doing more encapsulation here. I'd

[gentoo-portage-dev] [PATCH] bindbapi: add reentrant lock method (bug 685236)

2019-05-06 Thread Zac Medico
Add a reentrant lock/unlock method which is useful for things like emaint binhost and eclean-pkg. The vardbapi class already provides lock/unlock methods that behave the same way. Bug: https://bugs.gentoo.org/685236 Signed-off-by: Zac Medico --- lib/portage/dbapi/bintree.py |