• Post Reply Bookmark Topic Watch Topic
  • New Topic

is it illegal to alter the signature of lock()/unlock() method in Data class ?

 
morph wang
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is it illegal to alter the signature of lock()/unlock() method in Data class ?
If not, I think it's hard to track the client ID in it. (I'm using RMI)
 
veron luis
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
You can do whatever you want in you program (assignment) as long as you can explain the reason in you "design" documentation.

Cheers,
luis
 
John Lee
Ranch Hand
Posts: 2545
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is legal not to alter the signature of lock()/unlock() method in Data class.
What I did is:
public void lock( int record )
{
synthronized(this) {
....................
}
}
Don
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
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!