fix
parent
3e6281177a
commit
9982245715
|
@ -52,9 +52,8 @@ public class ThreadsafeSimplifiedList<T> implements SimplifiedList<T> {
|
|||
}
|
||||
}
|
||||
try {
|
||||
return (ptr.element);
|
||||
}
|
||||
finally {
|
||||
return delay(ptr.element);
|
||||
} finally {
|
||||
ptr.lock.unlock();
|
||||
}
|
||||
}
|
||||
|
@ -113,10 +112,13 @@ public class ThreadsafeSimplifiedList<T> implements SimplifiedList<T> {
|
|||
throw new IndexOutOfBoundsException(index + " out of bounds");
|
||||
}
|
||||
}
|
||||
try {
|
||||
var prevElement = ptr.element;
|
||||
ptr.element = element;
|
||||
ptr.lock.unlock();
|
||||
return prevElement;
|
||||
} finally {
|
||||
ptr.lock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue