Hi all,
When i review my assignment instruction, i got a problem.I show you the comments about and above lock()
// Locks a record so that it can only be updated or deleted by this client.
// Returned value is a cookie that must be used when the record is unlocked,
// updated, or deleted. If the specified record is already locked by a different
// client, the current
thread gives up the CPU and consumes no CPU cycles until
// the record is unlocked.
public long lock(int recNo) throws RecordNotFoundException;
Does it mean if some other client already locked a certain record, my calling of lock() will have to wait until that client unlock? If so ,why we have to distiguish cookie and lockCookie.I mean after waiting everyclient will get the lockCookie.Can anyone explain this?