Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

NX:Booking a Seat

 
guyue0505
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I have a question about synchronized like these:
1) I have a class named LockManager whitch do "genCookie", "LockRecord" ,
"unlockRecord" ...
synchronized boolean unlockRecNo(
long recNo , long lockCookie ){
....
}
synchronized boolean lockRecNo(
long recNo , long lockCookie ){
....
}
2) In client, when i Book a seat I do like:
lockManager.LockRecord;
Book;
lockManager.unlock;
Doing like these , is right?
Thank you first.
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Posts: 12056
232
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Steven,
You have been asked 9 times to change your name to meet the JavaRanch Naming Policy. Your account will now be closed.
Andrew
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!