On Thu, May 15, 2008 at 10:21 PM, Matthew Toseland
<toad at amphibian.dyndns.org> wrote:
> On Sunday 11 May 2008 18:05, j16sdiz at freenetproject.org wrote:
>> Author: j16sdiz
>> Date: 2008-05-11 17:05:03 +0000 (Sun, 11 May 2008)
>> New Revision: 19897
>>
>> Modified:
>>
> branches/saltedhashstore/freenet/src/freenet/store/SaltedHashFreenetStore.java
>> Log:
>> Fix datastore resize
>>
>>
> ...
>> -                                             try {
>> +                                     boolean[] locked = new 
>> boolean[newOffset.length];
>> +                                     try {
>> +                                             // Lock all possible slots 
>> first
>> +                                             for (int i = 0; i < 
>> newOffset.length; i++) {
>> +                                                     if 
>> (lockEntry(newOffset[i])) { // lock
>> +                                                             locked[i] = 
>> true;
>> +                                                     } else if (shutdown) { 
>> // oops
>> +                                                             return;
>> +                                                     }
>> +                                             }
>
> At what point are these unlocked?

finally{} block here:

>> +                                     } finally {
>> +                                             // unlock all entries
>> +                                             for (int i = 0; i < 
>> newOffset.length; i++) {
>> +                                                     if (locked[i]) {
>> +                                                             
>> unlockEntry(newOffset[i]);
>> +                                                     }
>> +                                             }
>>                                       }

Reply via email to