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