Re: Lock.lock("info")..

"Kedar C. Raybagkar via Concurrency-interest" <[email protected]> Mon, 22 Nov 2021 11:52:33 +0530
Newsgroups gmane.comp.java.jsr.166-concurrency
Message-ID <CAN8tCxVS+d01ULdEJaAe1v6VNKa7qt7RafLFQwzuUVbLbmb7kQ@mail.gmail.com>
--===============8258104476025911617==
Content-Type: multipart/alternative; boundary="0000000000009ccb2005d15aa89b"

--0000000000009ccb2005d15aa89b
Content-Type: text/plain; charset="UTF-8"

Thank you, David.

That is what I have been doing but instead of having to encapsulate into a
separate holder object I thought it might be a good idea to have some API
directly available. As encapsulation also results in having a Value Object
with hashcode and equals being overridden and then keeping them in a map
with thread ids. This is already within the lock; just an additional string
or object parameter may help solve the problem.

Regards,
-Kedar.

On Mon, 22 Nov 2021 at 11:28, David Holmes <[email protected]> wrote:

> Hi Kedar,
>
>
>
> The Lock and Condition should be encapsulated inside the object that needs
> them, and that object can provide whatever additional information the
> callers needs on its own methods.
>
>
>
> Cheers,
>
> David
>
>
>
> *From:* Concurrency-interest <[email protected]> *On
> Behalf Of *Kedar C. Raybagkar via Concurrency-interest
> *Sent:* Monday, 22 November 2021 3:43 PM
> *To:* [email protected]
> *Subject:* [concurrency-interest] Lock.lock("info")..
>
>
>
> Hi,
>
>
>
> Can we have something API where we can provide why we have acquired a lock
> so that when waiting on a condition if timed out we can fetch the info and
> return it to the caller?
>
>
>
> Regards,
>
> -Kedar.
>

--0000000000009ccb2005d15aa89b
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Thank you, David.</div><div><br></div><div>That is wh=
at I have been doing but instead of having to encapsulate=C2=A0into a separ=
ate holder object I thought it might be a good idea to have some API direct=
ly available. As encapsulation=C2=A0also results in having a Value Object w=
ith hashcode and equals being overridden and then keeping them in a map wit=
h thread ids. This is already within the lock; just an additional string or=
 object parameter may help solve the=C2=A0problem.</div><div><br></div><div=
>Regards,</div><div>-Kedar.</div></div><br><div class=3D"gmail_quote"><div =
dir=3D"ltr" class=3D"gmail_attr">On Mon, 22 Nov 2021 at 11:28, David Holmes=
 &lt;<a href=3D"mailto:[email protected]">[email protected]</=
a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0p=
x 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><d=
iv lang=3D"EN-AU" style=3D"overflow-wrap: break-word;"><div class=3D"gmail-=
m_5587418706740813621WordSection1"><p class=3D"MsoNormal"><span>Hi Kedar,<u=
></u><u></u></span></p><p class=3D"MsoNormal"><span><u></u>=C2=A0<u></u></s=
pan></p><p class=3D"MsoNormal"><span>The Lock and Condition should be encap=
sulated inside the object that needs them, and that object can provide what=
ever additional information the callers needs on its own methods.<u></u><u>=
</u></span></p><p class=3D"MsoNormal"><span><u></u>=C2=A0<u></u></span></p>=
<p class=3D"MsoNormal"><span>Cheers,<u></u><u></u></span></p><p class=3D"Ms=
oNormal"><span>David<u></u><u></u></span></p><p class=3D"MsoNormal"><span><=
u></u>=C2=A0<u></u></span></p><div style=3D"border-right:none;border-bottom=
:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0c=
m 0cm"><p class=3D"MsoNormal"><b><span lang=3D"EN-US">From:</span></b><span=
 lang=3D"EN-US"> Concurrency-interest &lt;<a href=3D"mailto:concurrency-int=
[email protected]" target=3D"_blank">concurrency-interest-bounces=
@cs.oswego.edu</a>&gt; <b>On Behalf Of </b>Kedar C. Raybagkar via Concurren=
cy-interest<br><b>Sent:</b> Monday, 22 November 2021 3:43 PM<br><b>To:</b> =
<a href=3D"mailto:[email protected]" target=3D"_blank">con=
[email protected]</a><br><b>Subject:</b> [concurrency-interes=
t] Lock.lock(&quot;info&quot;)..<u></u><u></u></span></p></div><p class=3D"=
MsoNormal"><u></u>=C2=A0<u></u></p><div><p class=3D"MsoNormal">Hi,<u></u><u=
></u></p><div><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div><div><p =
class=3D"MsoNormal">Can we have something API where we can provide why we h=
ave acquired a lock so that when waiting on a condition if timed out=C2=A0w=
e can fetch the info and return it to the caller?<u></u><u></u></p></div><d=
iv><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div><div><p class=3D"Ms=
oNormal">Regards,<u></u><u></u></p></div><div><p class=3D"MsoNormal">-Kedar=
.<u></u><u></u></p></div></div></div></div></blockquote></div>

--0000000000009ccb2005d15aa89b--

--===============8258104476025911617==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Concurrency-interest mailing list
[email protected]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest

--===============8258104476025911617==--