• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Unlocking all locks when GUI shuts down ?

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More a technical question:

When I use something like this:




Does this also unlock the lock when the GUI is closed ?
Is finally called when the GUI receives a shutdown request?
 
Ranch Hand
Posts: 59
Netbeans IDE VI Editor Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Daniel Breitner wrote:
Is finally called when the GUI receives a shutdown request?



Hi Daniel,

Quick test:



Outputs ....



So the shutdown sequence does not ensure the finally block gets executed. Does this help?

EDIT: Updated the code to call exit() from another thread.
 
Daniel Breitner
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, this certainly helps!
Thank you very much for your effort

Now I know that I have to deal with this situation and I also have to deal with it on the server side.
There it might be that several locks are still being hold by clients and

1) I have to prevent thatnew locks are being given to clients

2) I have to use a timeout to let all locks being unlocked ...

 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Daniel,

That will be one of the drawbacks of a thick/fat client. Before you start coding like a lunatic, maybe you can read this thread or this one first.

Kind regards,
Roel
 
Maybe he went home and went to bed. And took this tiny ad with him:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic