juanpablo-santos commented on PR #307:
URL: https://github.com/apache/jspwiki/pull/307#issuecomment-1743774024
Hi,
interesting PR! :-) My only comment is that I'd extract the lock behaviour
on a utility class something similar to (pseudocode, surely doesn't even
compile):
```java
public class Synchronizer {
public static < T > T synchronize( final ReentrantLock lock, final
Supplier< T > supplier ) {
lock.lock();
try {
return supplier.get();
} finally {
lock.unlock();
}
}
}
```
so code inside synchronized blocks can be passed as a lambda (also this
method could be overloaded so it could also receive some Runnable, Function,
etc.)
WDYT?
cheers,
juan pablo
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]