mirror of
https://github.com/corda/corda.git
synced 2025-06-23 01:19:00 +00:00
ENT-3187 Check that we're not calling toList
on concurrent collections (#4828)
* ENT-3165 Kotlin toList() does not work on concurrent collections. OS backport. ENT-3165 Added comment. * ENT-3187 Additional use of toList() on concurrent data structure.
This commit is contained in:
@ -62,7 +62,8 @@ class LazyPool<A>(
|
||||
*/
|
||||
fun close(): Iterable<A> {
|
||||
lifeCycle.justTransition(State.FINISHED)
|
||||
val elements = poolQueue.toList()
|
||||
// Does not use kotlin toList() as it currently is not safe to use on concurrent data structures.
|
||||
val elements = ArrayList(poolQueue)
|
||||
poolQueue.clear()
|
||||
return elements
|
||||
}
|
||||
|
Reference in New Issue
Block a user