Re: [jgroups-dev] anyway to do unlock in another thread

Bela Ban <[email protected]> Sat, 27 Apr 2013 10:24:22 +0200
Newsgroups gmane.comp.java.javagroups.devel
Message-ID <[email protected]>

On 4/27/13 5:42 AM, hyliu wrote:
> Hi, for some reason, a lock forgot to unlock in original thread. so I want
> have a way to do unlock when detect it. anyway can achieve this?


No. This is equivalent to ReentrantLock: when you call lock.lock() and 
forget to call lock.unlock() when done, the lock will remain locked 
forever, and you cannot unlock it in a different thread.

However, there is a LockService.unlockAll(), which forcefully unlocks 
all locks held by a client.


> (I know the right way would be assure to do unlock in original thread, while
> it's not controlled by me, what I can do is provider a way to detect it and
> unlock it manually by provide a jmx bean)


-- 
Bela Ban, JGroups lead (http://www.jgroups.org)

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Javagroups-development mailing list