Hi Java Gurus... I have implemented a lock manager which basically keep tracks of exclusive locks. I've found a bug but don't know how to fix it. Please help me if you know the solution. I am really desperate for some help. Here's a part of my source code. The problem is inlined as comments.
[This message has been edited by Jerson Chua (edited March 14, 2001).] Hi,
Please use [ code] [ /code] tags to format your code. Check out the UBB Code link below for further details
Thanks [This message has been edited by Rahul Mahindrakar (edited March 14, 2001).]
Rahul Rathore
Ranch Hand
Joined: Sep 30, 2000
Posts: 324
posted
0
Jerson, What was the need for a separate lock.acquire()? Would'nt it be better if put() into a mapOfLocks signifies the acquisition of locks? i.e. all locks put() in mapOfLocks must be acquired locks, otherwise they are not acquired. I think it is difficult to answer without seeing the rest of your code, and the purpose of you design? Which object calls lock() and for what purpose? What is the code of acquired()? What are the conditions under which a lock() is acquired and how/why are these conditions different from the conditions in which the lock is put() into the mapOfLocks.