pilgr/Paper

Race condition in KeyLocker

Opened this issue · 1 comments

Yrlec commented

Thank you for creating this great library!

I found a potential race condition on this line in KeyLocker:

if (!semaphoreMap.containsKey(key)) {

One should use putIfAbsent instead. See https://stackoverflow.com/a/15850870/71354 for an explanation.

pilgr commented

@Yrlec Good catch, thanks!