| Author |
Releasing locks
|
David Winters Junior
Ranch Hand
Joined: Oct 30, 2007
Posts: 47
|
|
All, I have decided to adapt a locking solution as follows: I have a seperate LockManager class to handle locking records so that only one client can modify a record at one time. In my Lock method i use a solution similar to Andrew MonkHouse whereby each client wanting to modiy a record will wait for a specific condition to be triggered. i include here andrew's code from his book for the reserve lock method I have completed the following code for the release lock counterpart of this method in the lock manager class and it works okay with the tests i have completed. I am looking for some feedback here on what one thinks of this code, is their any issues with it as far as one can see: Your input would be appreciated David
|
 |
Roman Yankin
Ranch Hand
Joined: Aug 27, 2008
Posts: 47
|
|
|
Hi David, honestly this approach is way too complicated, why don't you have just one ReentrantLock and just use lock()/unlock() before/after every operation that requires synchronization?
|
 |
 |
|
|
subject: Releasing locks
|
|
|